Skip to content

Commit

Permalink
Timegraph: Fixed undefined timeGraphEntries in tsp-data-provider
Browse files Browse the repository at this point in the history
Fixes #117

Signed-off-by: soukaina <soukaina.moussaoui@polymtl.ca>
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
  • Loading branch information
smouss authored and tahini committed Sep 28, 2020
1 parent b843a34 commit 48f0a4a
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ export class TspDataProvider {

async getData(ids: number[], entries: TimeGraphEntry[], viewRange?: TimelineChart.TimeGraphRange, resolution?: number): Promise<TimelineChart.TimeGraphModel> {
this.timeGraphEntries = [...entries];
if (!this.timeGraphEntries.length) {
return {
id: 'model',
totalLength: this.totalRange,
arrows: [],
rows: [],
data: {}
};
}

this.totalRange = this.timeGraphEntries[0].endTime - this.timeGraphEntries[0].startTime; // 1332170682540133097 - starttime
let statesParameters = QueryHelper.selectionTimeQuery(QueryHelper.splitRangeIntoEqualParts(1332170682440133097, 1332170682540133097, 1120), ids);
if (viewRange && resolution) {
Expand All @@ -43,7 +53,6 @@ export class TspDataProvider {

// the start time which is normalized to logical 0 in timeline chart.
const chartStart = this.timeGraphEntries[0].startTime;

const rows: TimelineChart.TimeGraphRowModel[] = [];
this.timeGraphRows.forEach((row: TimeGraphRow) => {
const rowId: number = (row as any).entryID;
Expand Down

0 comments on commit 48f0a4a

Please sign in to comment.