Skip to content

Commit 87118fc

Browse files
committed
feat: add execution time measurements
1 parent 5e5c655 commit 87118fc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/pluggableWidgets/datagrid-web/src/features/data-export/DSExportRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export class DSExportRequest {
114114
}
115115

116116
send = (): Promise<void> => {
117+
performance.mark("DSExportRequest_send");
117118
this.emitLoadStart();
118119
this._status = "awaiting";
119120
this.offset = 0;
@@ -230,6 +231,9 @@ export class DSExportRequest {
230231
this.emitEnd();
231232
this.emitLoadEnd();
232233
this.dispose();
234+
performance.mark("DSExportRequest_end");
235+
const measure = performance.measure("DSExportRequest", "DSExportRequest_send", "DSExportRequest_end");
236+
console.debug(`DSExportRequest: export took ${(measure.duration / 1000).toFixed(2)} seconds`);
233237
}
234238

235239
private dispose(): void {

packages/shared/widget-plugin-grid/src/select-all/SelectAllController.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export class SelectAllController implements ReactiveController {
112112
this.abortController = new AbortController();
113113
const signal = this.abortController.signal;
114114

115+
performance.mark("SelectAll_Start");
115116
try {
116117
this.emitter.dispatchEvent(pe("loadstart"));
117118
let loading = true;
@@ -142,6 +143,9 @@ export class SelectAllController implements ReactiveController {
142143
this.locked = false;
143144
this.emitter.dispatchEvent(pe("loadend"));
144145
this.abortController = undefined;
146+
performance.mark("SelectAll_End");
147+
const measure1 = performance.measure("Measure1", "SelectAll_Start", "SelectAll_End");
148+
console.debug(`Data grid 2: select all took ${(measure1.duration / 1000).toFixed(2)} seconds`);
145149
}
146150
}
147151

0 commit comments

Comments
 (0)