Skip to content

Commit a69edea

Browse files
committed
Show query executions delta as integer rather than float
1 parent 5bc8a59 commit a69edea

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

site/static/detailed-query.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ <h3 id="title"></h3>
9191
return time / 1000000000;
9292
}
9393

94-
function fmt_delta(to, delta) {
94+
function fmt_delta(to, delta, is_integral_delta) {
9595
let from = to - delta;
9696
let pct = (to - from) / from * 100;
9797
if (from == to) {
@@ -110,7 +110,12 @@ <h3 id="title"></h3>
110110
if (Math.abs(delta) <= 0.05) {
111111
classes = "neutral";
112112
}
113-
let text = delta.toFixed(3);
113+
let text;
114+
if (is_integral_delta) {
115+
text = delta.toString();
116+
} else {
117+
text = delta.toFixed(3);
118+
}
114119
if (pct != Infinity && pct != -Infinity) {
115120
text += `(${pct.toFixed(1)}%)`.padStart(10, ' ');
116121
} else {
@@ -260,13 +265,13 @@ <h3 id="title"></h3>
260265
}
261266
td(row, to_seconds(cur.self_time).toFixed(3));
262267
if (delta) {
263-
td(row, fmt_delta(to_seconds(cur.self_time), to_seconds(delta.self_time)), true);
268+
td(row, fmt_delta(to_seconds(cur.self_time), to_seconds(delta.self_time), false), true);
264269
} else {
265270
td(row, "-", true);
266271
}
267272
td(row, cur.invocation_count);
268273
if (delta) {
269-
td(row, fmt_delta(cur.invocation_count, delta.invocation_count), true);
274+
td(row, fmt_delta(cur.invocation_count, delta.invocation_count, true), true);
270275
} else {
271276
td(row, "-", true);
272277
}
@@ -277,6 +282,7 @@ <h3 id="title"></h3>
277282
fmt_delta(
278283
to_seconds(cur.incremental_load_time),
279284
to_seconds(delta.incremental_load_time),
285+
false,
280286
),
281287
true).classList.add("incr");
282288
} else {

0 commit comments

Comments
 (0)