Skip to content

Allow graphing arbitary field data #385

Description

@jedevc

We should add unikraft <resource> graph. This new command, available on all resources would allow graphing fields of that resource over time. You would be able to observe those properties as they changed.

We should probably use https://github.com/NimbleMarkets/ntcharts.

This would generate a line graph which would keep updating as more information arrived of the memory usage of instance-foo:

$ unikraft instance graph <instance-foo> -f metrics.rss

 10│      ⣀⠤⠒⠉⠒⠤⡀                        
   │    ⡠⠊      ⠈⠢⡀                      
  5│  ⡠⠊          ⠈⠢⡀                    
   │⡠⠊              ⠈⠑⢄                 ⢀
  0│                   ⠑⡄              ⡔⠁
   │                    ⠈⠢⡀          ⡠⠊  
 -5│                      ⠈⠢⡀      ⡠⠊    
   │                        ⠈⠑⠢⢄⡠⠔⠊      
-10└─────────────────────────────────────
   '24 03/27   03/31   04/03   04/05     

We could also show this against the total amount of memory available (as a solid bar):

$ unikraft instance graph <instance-foo> -f resources.memory -f metrics.rss
...

What about showing it as a percentage? We need some processing:

$ unikraft instance graph <instance-foo> -f metrics.rss/resources.memory
...

We could even allow plotting two instances against each other, one of instance-foo and another of instance-bar together:

$ unikraft instance graph <instance-foo> <instance-bar> -f metrics.rss
...

We could show CPU usage by computing a time delta (or some other function):

$ unikraft instance graph <instance-foo> -f derivative(cpu_time)
...

Note

-f metrics.rss/resources.memory and -f derivative(cpu_time) do not exist yet.

There are kinda interesting though... and feel related to unikraft/cli#373. They're almost like "virtual fields"? Not really in the data model, but can be computed from it.

We should also support non-integer data. Some ideas:

  • bools could be graphed as a square signal
  • enums could be graphed as a histogram (when we have multiple inputs)

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions