Esempio n. 1
0
 boolean updateVariation(Measure measure, Object[] pastMeasure, int index) {
   if (pastMeasure != null
       && PastMeasuresLoader.hasValue(pastMeasure)
       && measure.getValue() != null) {
     double variation =
         (measure.getValue().doubleValue() - PastMeasuresLoader.getValue(pastMeasure));
     measure.setVariation(index, variation);
     return true;
   }
   return false;
 }
Esempio n. 2
0
 private void computeVariation(
     Resource resource, DecoratorContext context, PastSnapshot pastSnapshot) {
   List<Object[]> pastMeasures = pastMeasuresLoader.getPastMeasures(resource, pastSnapshot);
   compareWithPastMeasures(context, pastSnapshot.getIndex(), pastMeasures);
 }
Esempio n. 3
0
 @DependsUpon
 public Collection<Metric> dependsUponMetrics() {
   return pastMeasuresLoader.getMetrics();
 }
Esempio n. 4
0
 MeasureKey(Object[] pastFields) {
   metricId = PastMeasuresLoader.getMetricId(pastFields);
   characteristicId = PastMeasuresLoader.getCharacteristicId(pastFields);
   ruleId = PastMeasuresLoader.getRuleId(pastFields);
 }