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

@param name The base metric name
@param tags MUST be an even number of arguments representing key/value pairs of tags.
@return A new or existing timer.
497367
public Timer timer(String name, String... tags) {
        return timer(name, Tags.of(tags));
    }
111655
Timer getTimer(final String name) {
    return (Timer) timers.get(name, new Monitors.Factory<Timer>() {
        @Override
        public Timer createMonitor() {
          return new Timer(name);
        }
      });
  }
76492
public static Timer timer(String name, String... tags) {
        return globalRegistry.timer(name, tags);
    }
147753
public static String getMetricNameWithTags(String name, String... tags) {
    Preconditions.checkArgument(tags.length % 2 == 0,
        "The tag arguments should be tag name and tag value pairs");
    StringBuilder sb = new StringBuilder();
    sb.append(name);
    for (int i = 0; i < tags.length; i += 2) {
      sb.append('.').append(tags[i]).append(TAG_SEPARATOR).append(tags[i + 1]);
    }
    return sb.toString();
  }
840001
public static Timer timer(MetricLevel level, String name) {
    return getMetricRegistry(level).timer(METRIC_PREFIX + name);
  }
1099561
protected String getMetricNamePrefix(Map<String, Object> tags){
    String currentContextName = (String) tags.get(MetricContext.METRIC_CONTEXT_NAME_TAG_NAME);
    if (metricContextName == null || (currentContextName.indexOf(metricContextName) > -1)) {
      return currentContextName;
    }

    return JOINER.join(Strings.emptyToNull(metricsPrefix),
            metricContextName, tags.get("taskId"), tags.get("forkBranchName"), tags.get("class"));
  }
404528
public void setTags(java.util.Map<String, String> tags) {
        this.tags = tags == null ? null : new com.amazonaws.internal.SdkInternalMap<String, String>(tags);
    }
1348688
public function timer($metric, $duration = null, array $tags = array(), $sampleRate = AbstractMetric::DEFAULT_SAMPLE_RATE)
    {
        return new Timer($this->prefix($metric), $duration, array_merge($this->defaultTags, $tags), $sampleRate);
    }
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;
    }
1056872
public CreateAppRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1202340
@Override
  public Timer timer(String name) {
    final com.codahale.metrics.Timer timer = registry.timer(name);
    return new Timer() {

      @Override
      public Timer.Context time() {
        final com.codahale.metrics.Timer.Context timerContext = timer.time();
        return new Context() {
          @Override
          public void close() {
            timerContext.close();
          }
        };
      }

      @Override
      public void update(long duration, TimeUnit unit) {
        timer.update(duration, unit);
      }
    };
  }
83830
public TagQueueRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1370475
public CreateProjectRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1035073
public <R extends Request<T>> R addMarker(String tag, Object... args) {
        Marker marker = new Marker(tag,
                Thread.currentThread().getId(),
                Thread.currentThread().getName(),
                System.nanoTime());

        synchronized (markerListeners) {
            for (RequestListener.MarkerListener markerListener : markerListeners) {
                markerListener.onMarker(marker, args);
            }
        }

        if (logSlowRequests && requestBirthTime == 0) {
            requestBirthTime = System.nanoTime();
        }

        return (R) this;
    }
743100
public MetricName withTag(String key, String value) {
		return name(name).tags(tags).tag(key, value).build();
	}
641617
public static Stopwatch start(String name, String... tags) {
    final MonitorConfig.Builder configBuilder = MonitorConfig.builder(name);
    Preconditions.checkArgument(tags.length % 2 == 0,
        "The sequence of (key, value) pairs must have even size: one key, one value");
    for (int i = 0; i < tags.length; i += 2) {
      configBuilder.withTag(tags[i], tags[i + 1]);
    }

    return INSTANCE.get(configBuilder.build(), TimeUnit.MILLISECONDS).start();
  }
209495
public CreateRobotApplicationResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }