Measures the time taken for short tasks and the count of these tasks.

@param name The base metric name
@param tags Sequence of dimensions for breaking down the name.
@return A new or existing timer.
489579
public Timer timer(String name, Iterable<Tag> tags) {
        return Timer.builder(name).tags(tags).register(this);
    }
906548
public Counter counter(String name, String... tags) {
        return counter(name, Tags.of(tags));
    }
580110
public static Counter counter(String name, Iterable<Tag> tags) {
        return globalRegistry.counter(name, tags);
    }
295550
public Timer getTimer(String prefix, String... suffixes) {
    return this.metricContext.timer(MetricRegistry.name(prefix, suffixes));
  }
544391
public SegmentResponse withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1035956
public <T> void addMetric(String name, MetricTimeslice<T> timeslice)
    {
        metrics.put(name, timeslice);
    }
701185
def tag(name, tag_name):
    

    with LOCK:
        # just to check if <name> exists
        metric(name)

        TAGS.setdefault(tag_name, set()).add(name)
813752
private void addMetric(
      List<Metric> metrics,
      String name,
      TagList tags,
      Object value) {
    long now = System.currentTimeMillis();
    if (onlyNumericMetrics) {
      value = asNumber(value);
    }
    if (value != null) {

      TagList newTags = counters.matches(MonitorConfig.builder(name).withTags(tags).build())
          ? getTagListWithAdditionalTag(tags, DataSourceType.COUNTER)
          : getTagListWithAdditionalTag(tags, DataSourceType.GAUGE);
      Metric m = new Metric(name, newTags, now, value);
      metrics.add(m);
    }
  }
59539
public GetTagsResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
729805
public Tag getTagByName(String name) {
        Tag t = this.tags.get(name);
        if (null == t) {
            t = new Tag(name, this.workspace.getId(), "");
            this.tags.put(name, t);
        }
        return t;
    }
968892
public ApplicationResponse withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
74892
public CreateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
975256
public StartChannelResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
978384
public void startTimer(String name) {
        StopWatch sw = new StopWatch();
        sw.start();
        STOP_WATCHES.put(name, sw);
    }
36436
public CreateCoreDefinitionRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1352751
@SuppressWarnings("unchecked")
	public T tag(final String tag) {
		if (this.tags == null) {
			this.tags = new HashSet<>();
		}

		this.tags.add(tag);
		return (T) this;
	}
752116
public DescribeSimulationJobResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }