public MetricLoader getMetricLoader() { return new TestMetricLoader(); }
@Override public void loadMetricDictionary(MetricDictionary metricDictionary, DimensionDictionary dimensionDictionary) { buildMetricMakers(metricDictionary); // Metrics that directly aggregate druid fields List<MetricInstance> metrics = Arrays.asList( new MetricInstance((ApiMetricName) A_HEIGHT, longSumMaker, HEIGHT), new MetricInstance(A_WIDTH, longSumMaker, WIDTH), new MetricInstance(A_DEPTH, longSumMaker, DEPTH), new MetricInstance(A_LIMBS, longSumMaker, LIMBS), new MetricInstance(A_USERS, sketchMaker, USERS), new MetricInstance(A_OTHER_USERS, sketchMaker, USERS), new MetricInstance(A_ROW_NUM, rowNumMaker, new FieldName[] {}), new MetricInstance(A_AREA, productMaker, A_HEIGHT, A_WIDTH), new MetricInstance(A_VOLUME, productMaker, A_HEIGHT, A_WIDTH, A_DEPTH), new MetricInstance(A_DAY_AVG_USERS, simpleDailyAverageMaker, A_USERS), new MetricInstance(A_DAY_AVG_OTHER_USERS, simpleDailyAverageMaker, A_OTHER_USERS), new MetricInstance(A_DAY_AVG_LIMBS, simpleDailyAverageMaker, A_LIMBS) ); metrics.stream().map(MetricInstance::make).forEach(metricDictionary::add); metricDictionary.getScope("shapes").add( new MetricInstance(new LogicalMetricInfo(A_SCOPED_WIDTH.asName()), longSumMaker, WIDTH.asName()).make() ); //Allows us to add some non-numeric LogicalMetrics without having to write a Maker for them. Makers should //be written if using complex metrics in production code. NonNumericMetrics.getLogicalMetrics().forEach(metricDictionary::add); } }
@Override public void loadMetricDictionary(MetricDictionary metricDictionary, DimensionDictionary dimensionDictionary) { buildMetricMakers(metricDictionary); // Metrics that directly aggregate druid fields List<MetricInstance> metrics = Arrays.asList( new MetricInstance((ApiMetricName) A_HEIGHT, longSumMaker, HEIGHT), new MetricInstance(A_WIDTH, longSumMaker, WIDTH), new MetricInstance(A_DEPTH, longSumMaker, DEPTH), new MetricInstance(A_LIMBS, longSumMaker, LIMBS), new MetricInstance(A_USERS, sketchMaker, USERS), new MetricInstance(A_OTHER_USERS, sketchMaker, USERS), new MetricInstance(A_ROW_NUM, rowNumMaker, new FieldName[] {}), new MetricInstance(A_AREA, productMaker, A_HEIGHT, A_WIDTH), new MetricInstance(A_VOLUME, productMaker, A_HEIGHT, A_WIDTH, A_DEPTH), new MetricInstance(A_DAY_AVG_USERS, simpleDailyAverageMaker, A_USERS), new MetricInstance(A_DAY_AVG_OTHER_USERS, simpleDailyAverageMaker, A_OTHER_USERS), new MetricInstance(A_DAY_AVG_LIMBS, simpleDailyAverageMaker, A_LIMBS) ); metrics.stream().map(MetricInstance::make).forEach(metricDictionary::add); metricDictionary.getScope("shapes").add( new MetricInstance(new LogicalMetricInfo(A_SCOPED_WIDTH.asName()), longSumMaker, WIDTH.asName()).make() ); //Allows us to add some non-numeric LogicalMetrics without having to write a Maker for them. Makers should //be written if using complex metrics in production code. NonNumericMetrics.getLogicalMetrics().forEach(metricDictionary::add); } }
public MetricLoader getMetricLoader() { return new TestMetricLoader(); }