Skip to content

Render CLI UI in monitor with tty

Jonas Larsen requested to merge j_lar/use_tty_for_ascii_ui into master

What does this MR do and why?

For the prototype of the Monitor I escape characters to avoid introducing a new dependency. Now that the monitor has gained some support and I learned that we already use tty, I think it is time to use the tty gem to manage the screen buffer.

With tty we don't flood the terminal history with old "frames"

How to set up and validate locally

  1. Start the monitor: rails runner scripts/internal_events/monitor.rb i_code_review_user_create_mr
  2. Trigger an event in the Rails console: Gitlab::InternalEvents.track_event("i_code_review_user_create_mr", user: User.first, namespace: Namespace.last)
  3. Verify that the updated metrics and the new Snowplow are highlighted
  4. Exit the monitor: ctrl+c
  5. Verify that the terminal buffer is left nice and clean

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jonas Larsen

Merge request reports