File: scalability_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 (22 lines) | stat: -rwxr-xr-x 653 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
20
21
22
#!/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 collections import defaultdict
from pprint import pprint

from parse_output import *

results = list(parse_output(sys.stdin))
df = as_scalability_df(results)

output = defaultdict(list) # name: thread, min, max, mean, stdev
for (name, threads), data in df.groupby(['queue', 'threads']):
    s = data["msg/sec"].describe(percentiles=None)
    threads = int(threads)
    output[name].append([threads, *[int(s[f]) for f in ['min', 'max', 'mean', 'std']]])
json.dump(output, sys.stdout)
print()