microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.99k stars 29.19k forks source link

[Feature] Show time stamp and zone when code cell last ran #168792

Open rrmistry opened 2 years ago

rrmistry commented 2 years ago

Would be good to capture when the code cell ran at the bottom of the cell.

For example: image

This could be toggled with a switch if it is too verbose

greazer commented 2 years ago

Thanks for the idea @rrmistry! Seems like a reasonable request. However, can I ask for a bit more detail as to what spurred this request on? Why do you find it important information to have?

rrmistry commented 2 years ago

Thanks @greazer ! our use case is one where we have a lot of long-running notebooks executed by end-users on Azure VMs. Usual ETAs are in range of 4-8 hours.

So having a time stamp really makes it clear when troubleshooting which cells have completed in relation to external events.

One option is to alter user-behavior and ask to add print statements at the end of each code cell. But there are challenges here, especially for newly onboarded users / interns.

Having this functionality built-in would be hugely helpful in problem diagnosis!

hamzamohdzubair commented 2 years ago

This extension: last_executed_time provides the same functionality in jupyter notebooks

wmayner commented 2 years ago

Echoing @rrmistry, I often have expensive computations across several notebooks that I leave running, sometimes for days, and it's very useful to be able to see when they finished—e.g., was this the most recent run, or the one from last week?

I'm currently using the extension pointed out by @hamzamohdzubair, but I'd like to switch to VSCode instead of JupyterLab.

dns4861 commented 2 years ago

I would second that request. I often use notebooks for "quick-and-dirty" analysis that does not necessarily lead to a linear execution of cells. There it is very helpful to see when a cell has been executed last. I'm currently using the aforementioned extension in jupyter-lab but would like to switch everything over to VSCode.

romanovzky commented 2 years ago

I would like this feature as well.

charris-msft commented 2 years ago

My additional ask here is to keep displaying the last execution details until the cell completes its next successful run.

Right now, the previous execution time is replaced with the elapsed time when the cell is run again, preventing me from seeing whether I have enough time to get coffee, dinner or go on vacation before I can expect it to finish.

See the red text from this issue: Add previous execution time next to elapsed time in cell #9818 image

PedroMartinez4 commented 2 years ago

This feature would be incredibly useful for troubleshooting notebooks with long runtimes and/or many cells. Sometimes the process is not linear so a timestamp would greatly enhance the workflow of Jupyter in VS code.

charris-msft commented 2 years ago

Today I finished a new, purpose-built computer for working with Pandas, etc. So the first thing I wanted to do is see how much performance improvement I get for my $1500.

I am running through each cell, and adding a comment about the configuration as well as the execution time.

Example:

# old Execution time: 1m 35.7s
# new 1 Standard Phase Control: 42.3s
# new 2 Extreme Phase Control: 36.8s

I don't expect most users to do this kind of perf testing and tweaking of the OC settings on the motherboard, but I do expect them to care about the time it takes to execute different versions of a cell.

Now, if you really want to delight folks like me how about showing the elapsed/execution time and the previous execution time (as described above); and show me show me the last 10 executions when I click on a clock/history icon next to the execution time that displays the time for each, and the contents of the cell when it was executed; and let me diff the code between two different executions.

now-youre-gittin-it commented 2 years ago

I second @wmayner 's use-case, especially for machine learning tasks where many parameters may be tweaked and some but not all cells would need repeated execution. In fact, VSCode is helpful for running such code because it shows the time taken to run each cell by default, unlike JupyterLab. However, when the work is spread out over a period of multiple days and you need to troubleshoot issues, its tough to recall when the last cell-of-interest was run. Do hope this becomes a feature!

maciejkos commented 1 year ago

I strongly support this feature request too!

FayDoom commented 1 year ago

That's a feature I would really like to see !

lironle6 commented 1 year ago

+1 Missing this terribly since migrating from Jupyter Lab

roblourens commented 1 year ago

Adding this as a tooltip. This is in the current locale time zone. Let me know if this is what you are looking for

image
maciejkos commented 1 year ago

Thanks for working on it @roblourens !

I think a tooltip would be helpful in some use cases. What I think most people would want is what the last_executed_time Jupyter extension implements (as @greggman mentioned).

rrmistry commented 1 year ago

Hi @roblourens,

Thanks for the work!


It would still be nice to show timestamps directly in UI (without the tooltip)

Would you recommend:

wmayner commented 1 year ago

Thank you for the tooltip! I second the previous comment, though—having it directly on the UI, so it can be seen at a glance, would be great.

roblourens commented 1 year ago

We can look into having this behind a setting. I'd prefer to enable extensions to contribute this, but we don't have the right API for it.

nicocanali commented 1 year ago

Thanks a lot for this feature!

Another suggestion could be to persist this somehow (maybe with notebook tags?). For example, see how Colab does it:

image
tosaric commented 1 year ago

Is this feature already implemented, and if yes, how to add it?

joaofbravo commented 1 year ago

Is this feature already implemented, and if yes, how to add it?

Wondering the same for the in-cell display (not the tooltip).

marctorsoc commented 1 year ago

Thanks a lot for this feature!

Another suggestion could be to persist this somehow (maybe with notebook tags?). For example, see how Colab does it:

image

See my long comment here: https://github.com/microsoft/vscode-jupyter/issues/13338#issuecomment-1645393350

nonoash commented 6 months ago

Bumping this, doing some back and forth with Pycharm that has this feature implemented, it would be nice to have it in Vscode. i'd prefer this kind of minimalist verbose as the first 2 pic below (maybe without the TZ) similar to Pycharm and Jupuyer plugin Pycharm: image

rather than a full 3 lines style