コード例 #1
0
ファイル: ModelMetrics.java プロジェクト: hotbain/modeshape
  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);
      }
    }
  }
コード例 #2
0
ファイル: ModelMetrics.java プロジェクト: hotbain/modeshape
 /**
  * @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);
 }