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 execution timings to cell metadata #5009
Conversation
@rgbkrk What do you think of this approach to storing event times instead of generic start/end time? xref nteract/papermill#133 nteract/nteract#2660 |
I think this starts to make sense if there are more than 2 time markers (and thus more than 1 delta to compute). I see that in this PR there are only 2 time markers, what others do you plan to add (if any)? |
I agree. In the next steps section of the issue description I list some
other timings, especially a variety of them coming from iopub messages.
EDIT: I started adding iopub timings, but ended up having to add something like the [ForeignHandler](https://github.com/saulshanabrook/jupyterlab/blob/203a83acc2f22529621419d43bb9bc3ecdaf26cb/packages/console/src/foreign.ts#L34) iopub message tracking to the notebook, so that new messages that come in can be associated with the proper cell. I would like to merge in some work before starting on that, so that UIs can start to display this and so that we have smaller PRs that are easier to review/merge in.
…On Tue, Jul 31, 2018, 12:20 AM Brian E. Granger ***@***.***> wrote:
I think this starts to make sense if there are more than 2 time markers
(and thus more than 1 delta to compute). I see that in this PR there are
only 2 time markers, what others do you plan to add (if any)?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5009 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIZTDJTGatFiItoJXBGNfsS9-EEcIUjks5uL4aTgaJpZM4VnLX6>
.
|
@saulshanabrook looks like this needs a rebase... |
@ellisonbg Thanks, rebased. |
I have to update the tests on this. |
I am looking into including more timings, maybe available from #5033 |
I have rebased this branch and am working on adding the other timings. |
I have added the other timings for the iopub messages. Here are the metadata keys added that correspond to start times of execution:
And these correspond to end times:
|
I have to fix some tests and add a way to toggle this on and off. |
OK I added the ability to toggle this on and off with a command. It is saved in the notebook metadata under the |
I think you can both continue on with this PR and on nbformat. This likely does still belong in metadata, though should still be specced in nbformat's json schema. We can still type it as a strong field in the metadata. If we made it an official field outside the metadata, it would cause a major version bump because there are no allowed additional properties in the cell. Generally people don't want a major version bump of the format without good cause, as it forces breakages to lots of clients and leads to inevitable user support. |
+1
…On Fri, Nov 30, 2018 at 2:06 PM Kyle Kelley ***@***.***> wrote:
I think you can both continue on with this PR and on nbformat. This likely
does still belong in metadata, though should still be specced in
nbformat's json schema
<https://github.com/jupyter/nbformat/blob/master/nbformat/v4/nbformat.v4.schema.json>.
We can still type it as a strong field in the metadata.
If we made it an official field outside the metadata, it would cause a
major version bump because there are no allowed additional properties in
the cell. Generally people don't want a major version bump of the format
without good cause, as it forces breakages to lots of clients and
inevitable user support.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5009 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0Bn3TH26jsJvcFDJSZaukJNwSCCYks5u0avfgaJpZM4VnLX6>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com
|
The next steps on this PR are:
If anyone else is wants to get started with this, I am happy to answer any questions for them about how to proceed, working off this branch. I won't get to this for a bit! |
A daily active user here -- this should be P0. Thanks @saulshanabrook for the great work! The org should prioritize this. |
@saulshanabrook I would be happy to poke around and help out (as this was one of the best add-ons for jupyter notebook), but I can only do so if the changes to make are simple as
If you think there is something a noob can do (I can write subdicts well enough), please point me in the right direction! |
@riemannzetagambit This would require diving into some typescript coding :) If you are interested in trying it out, we have some notes on how to get started locally. I would recommend using VS Code for an editor as well, because it has great Typescript integration. |
@saulshanabrook Do you know if anyone is working on this ? |
@Madhu94 I don't believe so. |
@Madhu94 If you or anyone else would like to, I would be happy to provide support. |
Thanks @saulshanabrook Started on this. |
Minor clarification - Does the above comment imply a nested subdict? |
Ok to clean up branch, or should we wait until #6864 is merged? |
Yep! I'll delete it |
We do something similar in cocalc and will try to change our to be compatible with this. See sagemathinc/cocalc#3983. Note that we always record (and display in a hover) which kernel was used in evaluating the cell. Is there something in the spec (or envisioned for it) that records this? People can change the kernel at any time while going through and evaluating cells... |
Wow very true @williamstein, I hadn't thought about taking note of that until now. |
Partially addresses #3320 by allowing users to record cell execution timing information.
Toggle Recording Cell Timing
command that sets therecording_timing
notebook metadata key to true/false.record_timing
metadata key is true timing information is saved to the cell metadata when a cell is executed.We record multiple timing events that could be interpreted as "starting" and "ending" execution.
timing.iopub.status.busy
:header.date
ofiopub
status
busy messagetiming.iopub.execute_input
:header.date
ofiopub
execute_input
messagetiming.shell.execute_reply.started
:metadata.started
ofshell
execute_reply
messagetiming.shell.execute_reply
:header.date
ofshell
execute_repl
timing.iopub.status.idle
:header.date
ofiopub
status
busy messageNow third party extensions can use this information to display elapsed time of cell execution. Subsequent work includes: