You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pinot.apache.org by GitBox <gi...@apache.org> on 2018/11/26 20:41:05 UTC

[GitHub] apucher closed pull request #3548: [TE] frontend - harleyjj/rootcause - warning value uses aggregate mul…

apucher closed pull request #3548: [TE] frontend - harleyjj/rootcause - warning value uses aggregate mul…
URL: https://github.com/apache/incubator-pinot/pull/3548
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 b5f15f9590..6c87ff7068 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 4366fd0f76..a898f96e50 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' ],


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pinot.apache.org
For additional commands, e-mail: dev-help@pinot.apache.org