Skip to content
Ilya Sher P edited this page May 28, 2023 · 8 revisions

Timeline Design

Timeline is one of the main concepts in the UI of NGS. Take bash history and generalize it ... a lot.

TODO: sketch.

Definition

Timeline is a group of events, ordered on a time axis. The events are of different types.

Sample event types:

  • External program run:
    • Start
    • Output (maybe batched? needs design or will create dumpster like in other shells)
    • Progress
    • Log message
    • Finish
  • Note (user added a note) / Chat message (is there a difference)?
  • Monitoring notice such as service X is up/down.
  • A metric at the given point in time.
  • Annotation - a comment by a user about particular event, with the reference to an event
  • Scheduled event such as downtime start/end
  • Planned command to run (maybe, related: playbook)
  • Assignment of a user (who supposed to run planned command)
  • Synthetic - NGS detected situation X (.env file and started using it) (is it different from NGS log entry?)

TODO: phrase this: section, probably note, with starting and ending checks. Example: Note "Set DNS TTL to 5 minutes" + check "dig ....".

Requirements

Sharing

It should be possible to share Timeline, nearly real-time. Use case: 2 or more people fixing a production issue. Each participant should be able to see merged Timelines from all involved people in one place. Appended events should appear immediately in that view. The view should probably be the same as the interactive view of the person. That would allow seeing what others are doing while typing your own commands. TODO: sketch.

It should be of course clear in that mixed view what's the source of any given event/widget (user/monitoring system/log/etc)

Tagging

  • Tag any object
  • Filter by tags
  • Search by tags

Integrations

Timeline should support multiple sources of information. Whenever possible, link to original should be available.

Links to help should be provided. Examples:

  • aws ec2 could be linked to the online help of the AWS CLI.
  • CloudFormation documentation link from appropriate widget.

Playbooks

It should be easy to "instantiate" a set of commands and "play" them one by one, stopping between the commands to check that everything is OK. Maybe just run the commands sequentially until failure and provide a way to resume from that point, after manually fixing the problem. TODO: sketch.

Display Several Timelines

Maybe: ability to display several timelines at once. Use case accident analysis after the fact, when you want to see at one place what everybody has seen and what they did.

Same Widget Timeline

There should be a convenient way (UI-wise) to see all occurrences of a widget which displays the exact same information but at different times. Maybe a "history" button or horizontal scrolling.

Bookmarks and Annotations

One should be able to add bookmarks at any point in time. Annotation is just a textual comment. Bookmark is the same but references (attached to) a widget.

To consider: groups or trees for both bookmarks and annotations.

Design (WIP)

Each Timeline will have its own unique ID. This will assist sharing, etc.

Maybe: Each Timeline Item will have its own globally unique ID, to assist sharing and correlating.

Timeline type

Contains ordered list of TimelineItem.

Fields

  • id - unique id, format tl-YYYYMMDD-rrrrrrrrrr (r - random small letter)
  • name
  • _items - Arr of TimelineItem

Methods

  • Arr-like methods
    • push(Timeline, TimelineItem) - add TimelineItem (automatically at correct position)
    • len(Timeline)
    • [](Timeline)
    • each(Timeline, Fun)
    • map(Timeline, Fun)

TimelineItem type

Anything that can be present on the timeline

Fields

  • id - unique id, format tli-YYYYMMDD-rrrrrrrrrr (r - random small letter)
  • start_time - unix timestamp
  • end_time - unix timestamp
  • (maybe) last_activity_time - unix timestamp
  • name - semantically meaningful name

Methods

NoteTimelineItem type

Inherits TimelineItem.

ProcessTimelineItem type

Inherits TimelineItem.

Fields

  • status - enum: starting, running, paused, finished, failed

UnixProcessTimelineItem type

Inherits TimelineItem (Don't think it would have much in common with ProcessTimelineItem).

Fields

  • pid