Ejemplo n.º 1
0
  static {
    final Window[] windows = Window.values();
    final ValueMetric[] valueMetrics = ValueMetric.values();
    final DurationMetric[] durationMetrics = DurationMetric.values();
    ALL_METRICS =
        new ArrayList<MetricAttributeDefinition>(
            windows.length * (valueMetrics.length + durationMetrics.length));

    for (final Window window : windows) {
      for (final DurationMetric metric : durationMetrics) {
        final MetricAttributeDefinition attrDefn =
            new DurationMetricAttributeDefinition(metric, window);
        ALL_METRICS.add(attrDefn);
      }

      for (final ValueMetric metric : valueMetrics) {
        final MetricAttributeDefinition attrDefn =
            new ValueMetricAttributeDefinition(metric, window);
        ALL_METRICS.add(attrDefn);
      }
    }
  }
Ejemplo n.º 2
0
 /**
  * @param metric the duration metric (cannot be <code>null</code>)
  * @param window the metrics window (cannot be <code>null</code>)
  */
 DurationMetricAttributeDefinition(final DurationMetric metric, final Window window) {
   super(attributeName(metric.getLiteral(), window));
   this.handler = new GetDurationMetric(metric, window);
 }