Skip to content

Commit

Permalink
Ops with no id use an of 0
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Budiu <[email protected]>
  • Loading branch information
Mihai Budiu authored and ryzhyk committed Dec 9, 2021
1 parent 51a96dc commit 26be9bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
14 changes: 8 additions & 6 deletions rust/template/ddlog_profiler/profiler_ui/ui.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions rust/template/ddlog_profiler/profiler_ui/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,14 @@ class ProfileTable implements IHtmlElement {
this.tbody = this.table.createTBody();
}

protected getId(row: Partial<ProfileRow>): string | null {
if (row.opid == null)
return null;
return this.name.replace(/[^a-zA-Z0-9]/g, "_").toLowerCase() + "_" + row.opid.toString();
protected getId(row: Partial<ProfileRow>): string {
let id = row.opid;
let ids;
if (id == null)
ids = "0";
else
ids = id.toString();
return this.name.replace(/[^a-zA-Z0-9]/g, "_").toLowerCase() + "_" + ids;
}

protected addDataRow(indent: number, rowIndex: number, row: Partial<ProfileRow>,
Expand All @@ -440,7 +444,7 @@ class ProfileTable implements IHtmlElement {
children: row.children === undefined ? [] : row.children,
dd_op: row.dd_op === undefined ? "" : row.dd_op,
invocations: row.invocations === undefined ? -1 : row.invocations,
opid: row.opid === undefined ? -1 : row.opid,
opid: row.opid === undefined ? 0 : row.opid,
short_descr: row.short_descr === undefined ? "" : row.short_descr
};

Expand Down Expand Up @@ -651,8 +655,6 @@ class ProfileTable implements IHtmlElement {

protected findPathFromRow(r: Partial<ProfileRow>, id: string): string[] | null {
let thisId = this.getId(r);
if (thisId == null)
return null;
if (thisId == id) {
return [thisId];
}
Expand Down

0 comments on commit 26be9bf

Please sign in to comment.