See {@link com.codahale.metrics.MetricRegistry#getTimers(com.codahale.metrics.MetricFilter)}.

<p>
This method will return fully-qualified metric names if the {@link MetricContext} is configured
to report fully-qualified metric names.
</p>
178792
@Override
  public SortedMap<String, Timer> getTimers(MetricFilter filter) {
    return this.innerMetricContext.getTimers(filter);
  }
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"));
  }
225180
public static Timer getNamedTimer(String timerName, int todoFlags) {
		return getNamedTimer(timerName, todoFlags, Thread.currentThread()
				.getId());
	}
1224327
@Override
    public List<MetricSchemaRecord> filterRecords(SchemaQuery query) {
        requireNotDisposed();
        
        _logger.debug(query.toString());
        
        if(query instanceof MetricSchemaRecordQuery) {
        	long start = System.nanoTime();
        	List<MetricSchemaRecord> result = _schemaService.get(MetricSchemaRecordQuery.class.cast(query));
            _logger.debug("Time to filter records in ms: " + (System.nanoTime() - start) / 1000000);
            return result;
        } else {
        	long start = System.nanoTime();
        	List<MetricSchemaRecord> result = _schemaService.keywordSearch(KeywordQuery.class.cast(query));
            _logger.debug("Time to filter records in ms: " + (System.nanoTime() - start) / 1000000);
            return result;
        }
        
    }
517139
public Stream<Entry<MatchedName, MetricValue>> filter(Context t) {
        return t.getTSData().getCurrentCollection().get(this::match, x -> true).stream()
                .flatMap(this::filterMetricsInTsv);
    }
172595
@Override
  public SortedMap<String, Histogram> getHistograms(MetricFilter filter) {
    return getSimplyNamedMetrics(Histogram.class, Optional.of(filter));
  }
958819
@Override
  public String metricNamePrefix(boolean includeTagKeys) {
    return Joiner.on('.').join(includeTagKeys ? getTags() : this.tags.values());
  }
774643
@VisibleForTesting
	public int numProcessingTimeTimers() {
		int count = 0;
		for (InternalTimerServiceImpl<?, ?> timerService : timerServices.values()) {
			count += timerService.numProcessingTimeTimers();
		}
		return count;
	}
1212910
private String getQualifiedMetricName(String metricName) {
    try {
      if (SecurityUtils.isAuthenticationEnabled(mConfiguration)
          && AuthenticatedClientUser.get(mConfiguration) != null) {
        return Metric.getMetricNameWithTags(metricName, CommonMetrics.TAG_USER,
            AuthenticatedClientUser.get(mConfiguration).getName(), WorkerMetrics.TAG_UFS,
            MetricsSystem.escape(new AlluxioURI(mPath)), WorkerMetrics.TAG_UFS_TYPE,
            mUnderFileSystem.getUnderFSType());
      }
    } catch (IOException e) {
      // fall through
    }
    return Metric.getMetricNameWithTags(metricName, WorkerMetrics.TAG_UFS,
        MetricsSystem.escape(new AlluxioURI(mPath)), WorkerMetrics.TAG_UFS_TYPE,
        mUnderFileSystem.getUnderFSType());
  }
1198022
@Override
  public SortedMap<String, Counter> getCounters(MetricFilter filter) {
    return this.innerMetricContext.getCounters(filter);
  }
1304741
@Override
  public SortedMap<String, Counter> getCounters(MetricFilter filter) {
    return getSimplyNamedMetrics(Counter.class, Optional.of(filter));
  }
937239
@Override
  public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
    return this.innerMetricContext.getGauges(filter);
  }
1016422
public static Timer newTimer(String name, TimeUnit unit, TaggingContext context) {
    final MonitorConfig config = MonitorConfig.builder(name).build();
    return new ContextualTimer(config, context, new TimerFactory(unit));
  }
1373069
private List<ProducerAO> getFilteredProducers(String intervalName, TimeUnit timeUnit, String category, String subsystem) throws APIException {
        if (!StringUtils.isEmpty(category)) {
            return getProducerAPI().getAllProducersByCategory(category, intervalName, timeUnit, true);
        }

        if (!StringUtils.isEmpty(subsystem)) {
            return getProducerAPI().getAllProducersBySubsystem(subsystem, intervalName, timeUnit, true);
        }

        return getProducerAPI().getAllProducers(intervalName, timeUnit, true);
    }
1210586
@Override
    public List<Metric> transform(QueryContext context, List<Metric> metrics) {
        SystemAssert.requireArgument(metrics != null, "Cannot transform empty metric/metrics");
        if (metrics.isEmpty()) {
            return metrics;
        }

        // do a union transform, the reducer perform a sum calculation
        Transform unionTransform = new MetricUnionTransform(new CountValueUnionReducer());
        List<Metric> sumUnitMetric = unionTransform.transform(null, metrics);

        // union of all timestamp
        Set<Long> unionKeyset = sumUnitMetric.get(0).getDatapoints().keySet();

        // create a list of metrics, for every metric it has union of all timestamps
        List<Metric> paddingMetrics = new ArrayList<Metric>();

        // Padding Zeros for every datapoints map in every metric
        for (Metric metric : metrics) {
            Map<Long, Double> paddingDatapoints = new TreeMap<>();
            Set<Long> metricDPKeyset = metric.getDatapoints().keySet();

            // Calculate those timestamps this datapoint map doesn't have
            for (Long unionKey : unionKeyset) {
                if (!metricDPKeyset.contains(unionKey)) {
                    paddingDatapoints.put(unionKey, 0.0);
                }
            }

            // create paddingDatapoints
            paddingDatapoints.putAll(metric.getDatapoints());
            metric.setDatapoints(paddingDatapoints);
            paddingMetrics.add(metric);
        }

        // adding base metric
        paddingMetrics.add(sumUnitMetric.get(0));

        // do a divide_v transform
        // Transform divide_vTransform = transformFactory.createMetricZipperTransform(Function.DIVIDE_V);
        Transform divide_vTransform = new MetricZipperTransform(new DivideValueZipper());

        return divide_vTransform.transform(null, paddingMetrics);
    }
401918
@Override
  public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
    return getSimplyNamedMetrics(Gauge.class, Optional.of(filter));
  }
339491
public java.util.List<MetricFilter> getMetricFilters() {
        if (metricFilters == null) {
            metricFilters = new com.amazonaws.internal.SdkInternalList<MetricFilter>();
        }
        return metricFilters;
    }