Skip to content

Instantly share code, notes, and snippets.

@korthout
Created March 9, 2021 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korthout/760b5e024d77dce6b1efb5032375b54b to your computer and use it in GitHub Desktop.
Save korthout/760b5e024d77dce6b1efb5032375b54b to your computer and use it in GitHub Desktop.
Example idea for the visualization of the Zeebe log stream
1---------------------------------------------COMMAND------------------2021-03-09 15:00:00:000 UTC-|
| DEPLOYMENT CREATE *
|-------------------------------------------------------------------------------------zeebe-0.26.0-|\
| "resources": [ | |
| { "resource": "PD94...", "resourceType": "BPMN_XML", "resourceName": "...123.bpmn" } | |
| ], | |
| "deployedWorkflows": [ | |
| { | |
| "version": 1, "bpmnProcessId": "CheckProcessPreCheck", "workflowKey": 2251799813685249, | |
| "resourceName":"...123.bpmn" | |
| } | |
| ] | |
|--------------------------------------------------------------------------------------------------| |
|
2----------------------------------------------EVENT-------------------2021-03-09 15:00:00:010 UTC-|/
| DEPLOYMENT CREATED 2251799813685250 *
|-------------------------------------------------------------------------------------zeebe-0.26.0-|
| "resources": [ |
| { "resource": "PD94...", "resourceType": "BPMN_XML", "resourceName": "...123.bpmn" } |
| ], |
| "deployedWorkflows": [ |
| { |
| "version": 1, "bpmnProcessId": "CheckProcessPreCheck", "workflowKey": 2251799813685249, |
| "resourceName":"...123.bpmn" |
| } |
| ] |
|--------------------------------------------------------------------------------------------------|
@korthout
Copy link
Author

korthout commented Mar 9, 2021

This is a representation of a log containing 2 records:

  • on position 1 a command: DEPLOYMENT:CREATE
  • on position 2 an event: DEPLOYMENT:CREATED referring to the record on position 1 as its source

MVP:

  • read json input
  • output some block format
  • split record into metadata section and value section
  • the record value is just printed in a pretty json format
  • the record position can be displayed in the record metadata section
  • the source record position can be displayed in the record metadata section

Nice to haves:

  • value properties that are too large should be truncated
  • the source record position can be visualized in the same way as git log --graph
  • colors can be used for the record graph and to differentiate between events/commands or even different record value types
  • value properties can be displayed in a static table instead of pretty json
  • add this to zdb
  • add a --oneline flag to represent the log in a compact way (mostly focussed on order and source graph)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment