Browse Source

Merge pull request #14007 from GordonSmith/HPCC-24471

HPCC-24471 ECL Watch added activity count to graphs list

Reviewed-By: Miguel Vazquez <miguel.vazquez@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 years ago
parent
commit
df11e5c078
3 changed files with 62 additions and 5 deletions
  1. 16 2
      esp/src/eclwatch/GraphsWUWidget.js
  2. 3 3
      esp/src/eclwatch/nls/fr/hpcc.js
  3. 43 0
      esp/src/src/ESPWorkunit.ts

+ 16 - 2
esp/src/eclwatch/GraphsWUWidget.js

@@ -49,6 +49,10 @@ define([
             if (params.Wuid) {
             if (params.Wuid) {
                 var context = this;
                 var context = this;
                 this.wu = ESPWorkunit.Get(params.Wuid);
                 this.wu = ESPWorkunit.Get(params.Wuid);
+                this.wu.fetchActivities().then(function (_) {
+                    context._activitiesData = _;
+                    context.updateGrid();
+                });
 
 
                 this.timeline = new srcTimings.WUTimelineEx()
                 this.timeline = new srcTimings.WUTimelineEx()
                     .target(this.id + "TimelinePane")
                     .target(this.id + "TimelinePane")
@@ -138,7 +142,7 @@ define([
                         return (hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
                         return (hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
                     }
                     }
                 },
                 },
-                Type: { label: this.i18n.Type, width: 72, sortable: true }
+                activityCount: { label: this.i18n.Activities, width: 72, sortable: true }
             };
             };
         },
         },
 
 
@@ -154,10 +158,16 @@ define([
         refreshGrid: function (args) {
         refreshGrid: function (args) {
             this._timelineData = null;
             this._timelineData = null;
             this._graphsData = null;
             this._graphsData = null;
+            this._activitiesData = null;
 
 
             this.timeline.refresh();
             this.timeline.refresh();
 
 
             var context = this;
             var context = this;
+            this.wu.fetchActivities().then(function (_) {
+                context._activitiesData = _;
+                context.updateGrid();
+            });
+
             this.wu.getInfo({
             this.wu.getInfo({
                 onGetTimers: function (timers) {
                 onGetTimers: function (timers) {
                     //  Required to calculate Graphs Total Time  ---
                     //  Required to calculate Graphs Total Time  ---
@@ -170,7 +180,7 @@ define([
         },
         },
 
 
         updateGrid: function () {
         updateGrid: function () {
-            if (this._timelineData && this._graphsData) {
+            if (this._timelineData && this._graphsData && this._activitiesData) {
                 var context = this;
                 var context = this;
                 this.store.setData(this._graphsData.map(function (row) {
                 this.store.setData(this._graphsData.map(function (row) {
                     var timelineData = context._timelineData[row.Name];
                     var timelineData = context._timelineData[row.Name];
@@ -178,6 +188,10 @@ define([
                         row.WhenStarted = timelineData.started;
                         row.WhenStarted = timelineData.started;
                         row.WhenFinished = timelineData.finished;
                         row.WhenFinished = timelineData.finished;
                     }
                     }
+                    const activities = context._activitiesData[row.Name];
+                    if (activities) {
+                        row.activityCount = activities.length;
+                    }
                     return row;
                     return row;
                 }));
                 }));
                 this.grid.refresh();
                 this.grid.refresh();

+ 3 - 3
esp/src/eclwatch/nls/fr/hpcc.js

@@ -467,7 +467,7 @@ define(
         noDataMessage: "...Zéro lignes...",
         noDataMessage: "...Zéro lignes...",
         Node: "Noeud",
         Node: "Noeud",
         NodeGroup: "Groupe de nœuds",
         NodeGroup: "Groupe de nœuds",
-        NoErrorFound: "Aucune erreur trouvée \ n",
+        NoErrorFound: "Aucune erreur trouvée \n",
         NoFilterCriteriaSpecified: "Aucun critère de filtre spécifié.",
         NoFilterCriteriaSpecified: "Aucun critère de filtre spécifié.",
         None: "Aucun",
         None: "Aucun",
         NoPublishedSize: "Aucune taille publiée",
         NoPublishedSize: "Aucune taille publiée",
@@ -478,7 +478,7 @@ define(
         NothingSelected: "Rien a été sélectionné",
         NothingSelected: "Rien a été sélectionné",
         NotInSuperfiles: "Pas dans les Superfichiers",
         NotInSuperfiles: "Pas dans les Superfichiers",
         NotSuspendedbyUser: "Non suspendu par l'utilisateur",
         NotSuspendedbyUser: "Non suspendu par l'utilisateur",
-        NoWarningFound: "Aucun avertissement trouvé \ n",
+        NoWarningFound: "Aucun avertissement trouvé \n",
         NumberofParts: "Nombre de parties",
         NumberofParts: "Nombre de parties",
         NumberofSlaves: "Nombre d'esclaves",
         NumberofSlaves: "Nombre d'esclaves",
         OK: "Ok",
         OK: "Ok",
@@ -887,7 +887,7 @@ define(
         ValidateActivePackageMap: "Valider la carte du package actif",
         ValidateActivePackageMap: "Valider la carte du package actif",
         ValidatePackageContent: "Valider le contenu du package",
         ValidatePackageContent: "Valider le contenu du package",
         ValidatePackageMap: "Valider la carte des packages",
         ValidatePackageMap: "Valider la carte des packages",
-        ValidateResult: "===== Valider le résultat ===== \ n \ n",
+        ValidateResult: "===== Valider le résultat ===== \n\n",
         ValidateResultHere: "(Résultat de validation)",
         ValidateResultHere: "(Résultat de validation)",
         Validating: "En cours de valider",
         Validating: "En cours de valider",
         Value: "Valeur",
         Value: "Valeur",

+ 43 - 0
esp/src/src/ESPWorkunit.ts

@@ -863,6 +863,49 @@ const Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetTimers: onFetchTimers
             onGetTimers: onFetchTimers
         });
         });
     },
     },
+    fetchActivities() {
+        return (this._hpccWU as HPCCWorkunit).fetchDetails({
+            ScopeFilter: {
+                MaxDepth: 999999,
+                ScopeTypes: ["graph"]
+            },
+            ScopeOptions: {
+                IncludeMatchedScopesInResults: true,
+                IncludeScope: true,
+                IncludeId: true,
+                IncludeScopeType: true
+            },
+            PropertyOptions: {
+                IncludeName: false,
+                IncludeRawValue: false,
+                IncludeFormatted: false,
+                IncludeMeasure: false,
+                IncludeCreator: false,
+                IncludeCreatorType: false
+            },
+            NestedFilter: {
+                Depth: 999999,
+                ScopeTypes: ["activity"]
+            },
+            PropertiesToReturn: {
+                AllStatistics: false,
+                AllAttributes: false,
+                AllHints: false,
+                AllProperties: false,
+                AllScopes: true
+            }
+        }).then(response => {
+            const retVal = {};
+            response.forEach(scope => {
+                const graphID = scope.ScopeName.split(":")[1];
+                if (!retVal[graphID]) {
+                    retVal[graphID] = [];
+                }
+                retVal[graphID].push(scope.Id);
+            });
+            return retVal;
+        });
+    },
     fetchGraphs(onFetchGraphs) {
     fetchGraphs(onFetchGraphs) {
         if (this.graphs && this.graphs.length) {
         if (this.graphs && this.graphs.length) {
             onFetchGraphs(this.graphs);
             onFetchGraphs(this.graphs);