AWS Rust Platform Team
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: turbowish --- # Tokio Console Rewind/Replay The current Console allows a nice *live* view of the application that it is monitoring. But sometimes things happen quickly, and a user may not have been able to react to inspect the data they wanted. In such scenarios, the user wants to be able to *go back in time*: replay the Console those events again, with controls to pause, step forward or backward, and more. We envision a rich temporal feature set, but present it here in stages. Each stage builds new functionality on top of the previous stage. We expect to [launch][] with pausing, recording, and replaying. [launch]: #Launch-Deliverables-2021 [post launch features]: #Post-Launch-Deliverables-2022] The [post launch features][] described here are also desired by customers, but are not planned as part of the initial launch. (Want to help add them? [Come join us!](https://github.com/tokio-rs/console)). ## Launch Deliverables (2021) ### Pause Command ![PAUSED](https://i.imgur.com/eSYwIwh.png) Sometimes while watching the tasks play live, a user notices something out of the ordinary, and wants to select that task, and investigate its details. But with a live view, the task state will change, which may disrupt a user's attempt to interpret the output. Worse still, a single task's entry in the table of tasks competes with all the other tasks updating and adjusting relative orders in the table. The first stage of the time-travel feature is a **pause** command: a user presses the spacebar and this pauses all updates from incoming program events. They can still adjust the table, scroll, and view details, all while the updates are paused. Pressing spacebar again will reconnect the update channel and re-establish the live running state. It won't resume in real time from where it left off, but rather jump forward in time to reflect the current state of the application. ### Replay Command ![REPLAY](https://i.imgur.com/pl5mhF7.png) Pausing doesn't help when an interesting event has already passed. You would need to travel back in time to investigate it. When a user knows that they need that feature, they will initiate the subscriber enabling an option to **record** all events to a file as they happen. The Console application will be able to then read those recordings, and **replay** them as if viewing the user's application live (including the ability to pause, as described above). This also allows users to share recordings with other developers using the same version of the console, to help debug together. The user can also enable recordings in a benchmark, in production, or similar places where one might not normally actively view via the Console. The user can then replay the recordings at a later time. The replays will emulate the original timing of the events: if the recorded application took 30 minutes, then the replay will also be 30 minutes. (Other time-travel commands later in this document mitigate potential issues here.) The user has two ways to initiate replay: on the initial `console` command line invocation, and interactively during a live `console` connection. #### Command Line Replay The user can invoke the console application with a command line option that includes the path to the recording: `console --replay <path-to-recording>`. When replaying a recorded file, the console will not connect to a live application. During command line replay, resuming after a pause (i.e. hitting spacebar) runs the recording from the point where it was paused. #### Interactive Replay The user can issue a replay command to a live application that is running with the record option enabled. This will read the events from the start of the recording and display them in the console. The user inputs the replay command while interacting with a recording console via a dedicated command palette at the bottom of the console interface, typing `:replay`. This behavior is almost exactly the same as passing the recording via the command line; however, in this mode, one is still connected to the live application, and thus can skip ahead to the "current time". Therefore, there are two paths to resume a paused recording while attached to a live application. One can continue from the paused point in time, via the `:go forward` command (also written `:continue`, via analogy with a typical debugger user interface). Alternatively, one can jump forward in time to the live application state, via the `:go live` command. When paused while replaying a recording and attached to a live application, hitting spacebar is synonymous with `:go live` (i.e., it unpauses, and jumps forward in time, just the same as when one is paused and *not* recording). ## Post-Launch Deliverables (2022) ### Rewind Command ![step back 2s](https://i.imgur.com/rIg5kFY.png) If a notable event occurs late in the execution, replaying a recording from the beginning is tedious method of investigation. To address this, we allow the user to dynamically **rewind** while viewing a recording or live process. For maximum control, the user inputs the command via a dedicated command palette at the bottom of the console interface, where one indicates whether to step backward and forward and specifies by how much to step: `:step back 2s` steps backward two seconds, and `:step forward 2s` steps forward two seconds. After a step completes, the console enters a paused state at that point in time in the recording. If the user wishes to resume forward execution, they can issue the command `:go forward`. ### Keyboard Macros A command palette maximizes expressive power, but typing long commands can be a burden, especially for repetitive actions like stepping backwards repeatedly while searching for an event of interest. To help the user avoid unnecessary typing, console will provide user-definable short-cuts, so that user-defined keystrokes like Ctrl-B can act as a shorthand for full commands like `:step back 2s`. To add a new shortcut, one uses the command palette, like so: `:define key Ctrl-B :step back 2s` ### Watch Command ![watch 286 polls](https://i.imgur.com/ZSiXxdw.png) Stepping backwards to search for an event of interest, even with keyboard short-cuts, is a tediuous and potentially error prone process for users. To address this, the console provides a **watch** command in the Console. The watch command operates analogously to watchpoints (a.k.a data breakpoints) in a typical debugger: when some data of interest changes, the system pauses. The user specifies a task and property of the task to "watch" (in the screenshot above, we are watching TID=286 and the Polls property, via the command `:watch 286 polls`). With a watchpoint in place, the process will automatically pause when the value has changed, or when the value matches a certain simple expression. This way, a user could be sure to catch every "poll" of a specific task, or catch the first time its poll time goes over a millisecond, as examples. Watchpoints compose with the time-travel commands: One set up a watchpoint, and then issue the command `:continue back` to run in reverse to see the most recent time that data cell changed.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully