command_runner/commands/top/tui/top_series library

Constants

maxSparklineBuckets → const int
The most columns a sparkline is drawn with: one per sample of the metrics window, which the server samples once a minute over an hour.

Functions

bucketSamples(List<MetricSample> samples, {required DateTime from, required DateTime to, required int buckets}) → List<double?>
Averages samples into buckets equal time slots between from and to. A slot without a sample is null, so a gap stays a gap.
formatCores(double cores) → String
Formats a CPU usage in cores, for example 0.38 cores.
formatRate(double perSecond) → String
Formats a request rate, for example 12.4 req/s.
formatShare(double part, double total) → String
Formats part as a percentage of total, for example 0.4%.
latestValue(List<double?> values) → double?
The most recent value of values, or null if there is none.
sparkline(List<double?> values) → String
Draws values as one block character per value, scaled from zero to the highest value. A null value is drawn as a space.
sumBuckets(List<List<double?>> series) → List<double?>
Adds up series slot by slot. A slot is null when no series has a value in it.
totalSeries(List<List<MetricSample>> series, {required DateTime from, required DateTime to, int buckets = maxSparklineBuckets}) → List<double?>
The total of series over time, as buckets slots between from and to.