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

Add short execution threshold for ExecutionTime plugin #1336

Merged
merged 6 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ define([
executed: 'executed in ${duration}, finished ${end_time}',
queued: 'execution queued ${start_time}',
},
hide_shorter_than_threshold_in_ms: 0,
};

function patch_CodeCell_get_callbacks () {
Expand Down Expand Up @@ -269,6 +270,9 @@ define([
var exec_time = -start_time.diff(end_time);
msg = msg.replace('${duration}', humanized_duration(exec_time));
}
if (exec_time < options.hide_shorter_than_threshold_in_ms ) {
Tautvis marked this conversation as resolved.
Show resolved Hide resolved
toggle_timing_display([cell], false);
}
timing_area.text(msg);
return timing_area;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,12 @@ Parameters:
replacement tokens.
default: 'execution queued ${start_time}'
input_type: text

- name: ExecuteTime.hide_shorter_than_threshold_in_ms
description: |
Hide execution timings that are shorter than this threshold (in ms). Set to
zero to show all timings.
default: 0
input_type: number
step: 1
min: 1
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ The available options are:
cells. The template uses an ES2015-like syntax, but replaces only the exact
strings `${start_time}`, plus (if defined) `${end_time}` and `${duration}`.
Defaults to `'execution queued ${start_time}'`.

* `ExecuteTime.hide_shorter_than_threshold_in_ms`: Threshold to hide execution
timings that are short. Set this to zero to show all timings.
Defaults to `0`.



Expand Down