This is an automated email from the ASF dual-hosted git repository. apucher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push: new 81589c7 [TE] frontend - harleyjj/rootcause - warning value uses aggregate multiplier and can be turned off if aggregates change without slider being adjusted (#3548) 81589c7 is described below commit 81589c757dbfe21a13a5f3369a9accf955f86042 Author: Harley Jackson <harleyy...@gmail.com> AuthorDate: Mon Nov 26 12:41:03 2018 -0800 [TE] frontend - harleyjj/rootcause - warning value uses aggregate multiplier and can be turned off if aggregates change without slider being adjusted (#3548) --- .../app/pods/components/rootcause-anomaly/component.js | 14 ++++++++------ .../pods/components/rootcause-anomaly/component-test.js | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-anomaly/component.js b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-anomaly/component.js index b5f15f9..6c87ff7 100644 --- a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-anomaly/component.js +++ b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-anomaly/component.js @@ -327,7 +327,6 @@ export default Component.extend({ }; } }); - return anomalyInfo; } ), @@ -356,12 +355,16 @@ export default Component.extend({ */ isWarning: computed('anomalyInfo', 'isRangeChanged', function () { if(!get(this, 'isRangeChanged')) { - let oldCurrent = parseFloat(get(this, 'current')); - const newCurrent = this._getAggregate('current'); - if (newCurrent && oldCurrent){ + const oldCurrent = parseFloat(get(this, 'current')); + let newCurrent = this._getAggregate('current'); + const aggregateMultiplier = parseFloat(get(this, 'aggregateMultiplier')); + if (newCurrent && oldCurrent && aggregateMultiplier){ + newCurrent = newCurrent * aggregateMultiplier; const diffCurrent = Math.abs((newCurrent-oldCurrent)/newCurrent); if (diffCurrent > 0.01) { set(this, 'warningValue', true); + } else { + set(this, 'warningValue', false); } } } @@ -373,7 +376,7 @@ export default Component.extend({ * @type {string} */ warningChangedTo: computed('warningValue', function() { - const newCurrent = this._getAggregate('current'); + const newCurrent = this._getAggregate('current') * parseFloat(get(this, 'aggregateMultiplier')); return humanizeFloat(newCurrent); }), @@ -392,7 +395,6 @@ export default Component.extend({ if (value === 0.0) { return Number.NaN; } return value / (aggregateMultiplier || 1.0); } - return aggregates[toOffsetUrn(metricUrn, offset)]; }, diff --git a/thirdeye/thirdeye-frontend/tests/integration/pods/components/rootcause-anomaly/component-test.js b/thirdeye/thirdeye-frontend/tests/integration/pods/components/rootcause-anomaly/component-test.js index 4366fd0..a898f96 100644 --- a/thirdeye/thirdeye-frontend/tests/integration/pods/components/rootcause-anomaly/component-test.js +++ b/thirdeye/thirdeye-frontend/tests/integration/pods/components/rootcause-anomaly/component-test.js @@ -74,7 +74,7 @@ module('Integration | Component | rootcause-anomaly', function(hooks) { score : [ '0.03195732831954956' ], functionId : [ '1' ], current : [ '93453.15844726562' ], - aggregateMultiplier : [ '0.041666666666666664' ], + aggregateMultiplier : [ '1' ], metricId : [ '1' ], metric : [ 'metric' ], function : [ 'function' ], --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org