Pandas History Client
- class metricq.pandas.PandasHistoryClient(*args, **kwargs)
This can be used similarly to a
metricq.HistoryClient, but the data methods return pandas structures.Note
Consider this class experimental, the type signatures may change at any time.
- await connect()
Connect to the MetricQ network. You can either use this method, or use the class as an async context manager.
- Return type:
- await stop()
Stop the client and disconnect from the MetricQ network. Do not call this if you use the class as an async context manager.
- Return type:
- property client: HistoryClient
Access the underlying
metricq.HistoryClientinstance.
- await get_metrics(*args, **kwargs)
The method works like
metricq.Client.get_metrics(), but setshistoric=Trueby default. See documentation there for a detailed description of the remaining arguments.
- await history_aggregate_timeline(*args, **kwargs)
The method works like
metricq.HistoryClient.history_aggregate_timeline(), but returns apandas.DataFrame. The dataframe will have the following columns:timestamp
minimum
maximum
sum
count
integral_ns
active_time
mean
mean_integral
mean_sum
integral_s
For details of those, see the documentation of
metricq.TimeAggregate.- Return type:
DataFrame
- await history_raw_timeline(*args, **kwargs)
The method works like
metricq.HistoryClient.history_raw_timeline(), but returns apandas.DataFrameinstead of a list ofmetricq.TimeValueobjects. The dataframe will have the following columns:timestamp
value
- Return type:
DataFrame