File: latency_to_json.py

package info (click to toggle)
libatomic-queue 0.0%2Bgit20220518.83774a2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,352 kB
  • sloc: cpp: 1,620; javascript: 353; makefile: 131; python: 82; ansic: 74; sh: 59
file content (19 lines) | stat: -rwxr-xr-x 521 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

# Copyright (c) 2019 Maxim Egorushkin. MIT License. See the full licence in file LICENSE.

import sys
import pandas as pd
import json
from pprint import pprint

from parse_output import *

results = list(parse_output(sys.stdin))
df = as_latency_df(results)
output = dict() # name: min, max, mean, stdev
for name, data in df.groupby('queue'):
    s = data["sec/round-trip"].describe()
    output[name] = [int(s[f] * 1e9) for f in ['min', 'max', 'mean', 'std']]
json.dump(output, sys.stdout)
print()