Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-21657 ECL Watch graphs page missing start/finish times #12302

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 35 additions & 13 deletions esp/src/eclwatch/GraphsWUWidget.js
Expand Up @@ -8,16 +8,17 @@ define([
"hpcc/GraphsWidget",
"src/ESPWorkunit",
"hpcc/DelayLoadWidget",

"@hpcc-js/eclwatch"
"src/Timings"

], function (declare,
ContentPane,
selector,
GraphsWidget, ESPWorkunit, DelayLoadWidget,
hpccEclWatch) {
srcTimings) {
return declare("GraphsWUWidget", [GraphsWidget], {
wu: null,
_graphsData: null,
_timelineData: null,

postCreate: function (args) {
this.inherited(arguments);
Expand Down Expand Up @@ -49,14 +50,8 @@ define([
if (params.Wuid) {
var context = this;
this.wu = ESPWorkunit.Get(params.Wuid);
var monitorCount = 4;
this.wu.monitor(function () {
if (context.wu.isComplete() || ++monitorCount % 5 === 0) {
context.refreshGrid();
}
});

this.timeline = new hpccEclWatch.WUTimeline()
this.timeline = new srcTimings.WUTimelineEx()
.target(this.id + "TimelinePane")
.maxZoom(Number.MAX_SAFE_INTEGER)
.overlapTolerence(1)
Expand All @@ -83,8 +78,18 @@ define([
}
}
}, true)
.render()
.on("setData", function (_) {
context._timelineData = _;
context.updateGrid();
})
;

var monitorCount = 4;
this.wu.monitor(function () {
if (context.wu.isComplete() || ++monitorCount % 5 === 0) {
context.refreshGrid();
}
});
}

this._refreshActionState();
Expand Down Expand Up @@ -148,16 +153,33 @@ define([
},

refreshGrid: function (args) {
this._timelineData = null;
this._graphsData = null;

this.timeline.refresh();

var context = this;
this.wu.getInfo({
onGetTimers: function (timers) {
// Required to calculate Graphs Total Time ---
},
onGetGraphs: function (graphs) {
context.store.setData(graphs);
context.grid.refresh();
context._graphsData = graphs;
context.updateGrid();
}
});
},

updateGrid: function () {
if (this._timelineData && this._graphsData) {
var context = this;
this.store.setData(this._graphsData.map(function (row) {
row.WhenStarted = context._timelineData[row.Name].started;
row.WhenFinished = context._timelineData[row.Name].finished;
return row;
}));
this.grid.refresh();
}
}
});
});
33 changes: 33 additions & 0 deletions esp/src/src/Timings.ts
Expand Up @@ -355,3 +355,36 @@ export class Timings {
click(row, col, sel) {
}
}

export class WUTimelineEx extends WUTimeline {

constructor() {
super();
}

data(): any;
data(_: any): this;
data(_?: any): any | this {
const retVal = super.data.apply(this, arguments);
if (arguments.length) {
const timeData = {};
_.map(function (row) {
timeData[row[0]] = {
started: row[1],
finished: row[2]
};
})
this.setData(timeData);
}
return retVal;
}

refresh() {
this.clear();
this.fetchScopes();
}

// Events ---
setData(timeData: { [graphID: string]: { started: string, finished: string } }) {
}
}