You can plot a single metric using .metrics.plot()
. This will create a plot based on plotly
.
source
ChronicleMetrics.plot
ChronicleMetrics.plot (name:str, service:str=None, title:str=None,
alias:str=None, sparkline:bool=None)
Plot a selected metric using a Plotly line plot
name
str
name of metric to extract
service
str
None
service to extract metric from
title
str
None
title of plot
alias
str
None
alias to use for new column
sparkline
bool
None
whether to use sparkline
Returns
Figure
m = (
scan_chronicle_metrics("./data" , "2023/04/03" )
.metrics.plot("rstudio_system_memory_used" , service = "workbench-metrics" , alias = "memory" )
)
assert type (m) == go.Figure
m
Unable to display output for mime type(s): application/vnd.plotly.v1+json
# # change plotly plot into sparkline
# layout = {
# 'xaxis': {'showgrid': False, 'showticklabels': False, 'zeroline': False},
# 'yasix': {'showgrid': False, 'showticklabels': False, 'zeroline': False},
# 'showlegend': False,
# }
# p.update_layout(
# showlegend=False,
# xaxis=dict(showgrid=False, showticklabels=False, zeroline=False, visible=False),
# yaxis=dict(showgrid=False, showticklabels=False, zeroline=False, visible=False),
# title=None,
# margin=dict(l=0, r=0, t=0, b=0),
# paper_bgcolor="rgba(0,0,0,0)",
# plot_bgcolor="rgba(0,0,0,0)",
# )
# p