tokio.analysis.umami module

Class and tools to generate TOKIO UMAMI plots

class tokio.analysis.umami.Umami(**kwds)[source]

Bases: collections.OrderedDict

Subclass of dictionary that stores all of the data needed to generate an UMAMI diagram. It is keyed by a metric name, and values are UmamiMetric objects which contain timestamps (x values) and measurements (y values)


Convert this object into a DataFrame, indexed by timestamp, with each column as a metric. The Umami attributes (labels, etc) are not expressed.

plot(output_file=None, highlight_index=-1, linewidth=1, linecolor='#853692', colorscale=['#DA0017', '#FD6A07', '#40A43A', '#2C69A9'], fontsize=12, figsize=(6.0, 1.3333333333333333))[source]

Create a graphical representation of the UMAMI object

  • output_file (str or None) – save umami diagram to file of given name
  • highlight_index (int) – index of measurement to highlight
  • linewidth (int) – linewidth for both timeseries and boxplot lines
  • linecolor (str) – color of line in timeseries panels
  • colorscale (list of str) – colors to use for data below the 25th, 50th, 75th, and 100th percentiles
  • fontsize (int) – font size for UMAMI labels
  • figsize (tuple of float) – x, y dimensions of a single UMAMI row; multiplied by len(self.keys()) to determine full diagram height

List of matplotlib.axis.Axis objects corresponding to each panel in the UMAMI diagram

Return type:



Return a representation of self as pandas.DataFrame

Returns:numerical representation of the values being plotted
Return type:pandas.DataFrame

Convert this object (and all of its constituent UmamiMetric objects) into a dictionary


Serialize self into a JSON string

Returns:JSON representation of numerical data being plotted
Return type:str
class tokio.analysis.umami.UmamiMetric(timestamps, values, label, big_is_good=True)[source]

Bases: object

A single row of an UMAMI diagram.

Logically contains timeseries data from a single connector, where the timestamps attribute is a list of timestamps (seconds since epoch), and the ‘values’ attribute is a list of values corresponding to each timestamp. The number of timestamps and attributes must always be the same.

append(timestamp, value)[source]

Can only add values along with a timestamp.


Analogous to the list .pop() method.


Create JSON-encoded string representation of self

Returns:JSON-encoded representation of values stored in UmamiMetric
Return type:str

Special serializer function that converts datetime into something that can be encoded in json