Пример #1
0
 buckets.forEach((t, i) => {
   const change = changes[urn][i];
   row[`${t}`] = {
     change: humanizeChange(change),
     direction: toColorDirection(change, isInverse(urn, entities))
   };
   row[`${t}_raw`] = makeSortable(change);
 });
Пример #2
0
      [...this.offsets].forEach(offset => {
        const value = this._getAggregate(offset);
        const change = curr / value - 1;

        anomalyInfo[offset] = {
          value: humanizeFloat(value), // numerical value to display
          change: humanizeChange(change), // text of % change with + or - sign
          direction: toColorDirection(change, isInverse(metricUrn, entities))
        };
      });
Пример #3
0
  metricUrns.forEach(urn => {
    // find first smaller or equal element
    const currentLookup = (lookup[toCurrentUrn(urn)] || []).reverse();
    const currentTimeseries = currentLookup.find(t => t[0] <= hoverTimestamp);
    const current = currentTimeseries && currentTimeseries[1] ? currentTimeseries[1] : Number.NaN;

    const baselineLookup = (lookup[toBaselineUrn(urn)] || []).reverse();
    const baselineTimeseries = baselineLookup.find(t => t[0] <= hoverTimestamp);
    const baseline = baselineTimeseries && baselineTimeseries[1] ? baselineTimeseries[1] : Number.NaN;

    const change = current / baseline - 1;

    values[urn] = {
      current: humanizeFloat(current),
      baseline: humanizeFloat(baseline),
      delta: humanizeChange(change),
      color: toColorDirection(change, isInverse(urn, entities))
    };
  });
Пример #4
0
 function () {
   const { selectedUrn, entities } = this.getProperties('selectedUrn', 'entities');
   return isInverse(selectedUrn, entities);
 }