@Override public Builder tag(String key, String value) { Tags.tags(this.tags, key, value); return this; }
@Override public Builder tags(Iterable<Tag> tags) { Tags.tags(this.tags, tags); return this; }
@Override public Builder tags(String... keyValues) { Tags.tags(this.tags, keyValues); return this; }
@Override public Builder tag(String key, String value) { Tags.tags(this.tags, key, value); return this; }
@Override public Builder tags(String... keyValues) { Tags.tags(this.tags, keyValues); return this; }
@Override public Builder tags(Iterable<Tag> tags) { Tags.tags(this.tags, tags); return this; }
@Override public Builder tags(String... keyValues) { Tags.tags(this.tags, keyValues); return this; }
@Override public Builder tag(String key, String value) { Tags.tags(this.tags, key, value); return this; }
@Override public Builder tags(Map<String, String> tags) { Tags.tags(this.tags, tags); return this; }
@Override public Builder tags(Map<String, String> tags) { Tags.tags(this.tags, tags); return this; }
@Override public Builder tags(Iterable<Tag> tags) { Tags.tags(this.tags, tags); return this; }
@Override public Builder tags(Map<String, String> tags) { Tags.tags(this.tags, tags); return this; }
private void startObservation(ObserverContext observerContext, String[] mainTags) { observerContext.addProperty(PROPERTY_START_TIME, System.nanoTime()); String connectorName = observerContext.getConnectorName(); Set<Tag> mainTagSet = new HashSet<>(mainTags.length); try { // Tags are validated (both key and value should not be null) Tags.tags(mainTagSet, mainTags); getInprogressGauge(connectorName, mainTagSet).increment(); } catch (RuntimeException e) { handleError(connectorName, mainTagSet, e); } }
Map<String, String> tagMap = Utils.toStringMap(tags); Set<Tag> tagSet = new HashSet<>(); Tags.tags(tagSet, tagMap); Metric metric = DefaultMetricRegistry.getInstance().lookup(new MetricId(metricName, "", tagSet));