def print_ts_aggregation(name, histograms):
header_names = ["start", "end", "count"]
data = [header_names]
if histograms is not None:
interval = histograms["bucketSizeInSeconds"]
title = name + "(interval = {})".format(hms_string(interval))
table = AsciiTable(data, title)
buckets = histograms["histogramBuckets"]
for bucket in buckets:
start = format_time_value(bucket["timeInSec"])
end = format_time_value(bucket["timeInSec"] + interval)
count = "{:,}".format(bucket["count"])
data_array = [start, end, count]
data.append(data_array)
else:
table = AsciiTable(data, name)
print(table.table)
评论列表
文章目录