Skip to content
Snippets Groups Projects
Verified Commit 11d66fe7 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

tools/plot*: cosmetic changes to latency and client distribution charts

parent 6e1ed544
No related branches found
No related tags found
1 merge request!27ui: allow traffic mixing
......@@ -26,7 +26,7 @@ COLORS = [matplotlib.colors.to_rgba(c)
def init_plot(title):
_, ax = plt.subplots(figsize=(8, 8))
_, ax = plt.subplots(figsize=(9, 9))
ax.set_xscale('log')
ax.set_yscale('log')
......@@ -82,6 +82,7 @@ def plot_client_query_scatter(ax, clients: Dict[str, int], color):
s = [size * (SCALE_MAGIC / s_tot) for size in s]
ax.scatter(x, y, s, color=color, alpha=0.5)
ax.scatter(x, y, linewidth=1, color=color, marker='x', alpha=0.5)
def main():
......@@ -121,7 +122,7 @@ def main():
handles.append(plot_client_query_scatter(ax, clients_qps, color))
ax.legend(lines, labels, loc="lower left")
plt.savefig(args.output, dpi=300)
plt.savefig(args.output)
sys.exit(0)
......
#!/usr/bin/env python3
import argparse
from itertools import cycle
import json
import logging
import math
......@@ -15,6 +16,11 @@ import matplotlib.pyplot as plt # noqa
JSON_VERSION = 20200527
COLOR_ACTIVE = cycle(['royalblue', 'cornflowerblue', 'darkblue', 'lightsteelblue'])
COLOR_TCP_HS = cycle(['forestgreen', 'limegreen', 'darkgreen', 'lightgreen'])
COLOR_TLS_RESUMED = cycle(['orange', 'moccasin', 'darkorange', 'antiquewhite'])
COLOR_FAILED_HS = cycle(['gray', 'silver', 'black', 'gainsboro'])
sinames = ['', ' k', ' M', ' G', ' T']
......@@ -109,16 +115,16 @@ def main():
name = os.path.splitext(os.path.basename(os.path.normpath(json_path)))[0]
if 'active' in args.kind:
plot(ax, data, label=f'Active ({name})', color='tab:blue',
plot(ax, data, label=f'Active ({name})', color=next(COLOR_ACTIVE),
eval_func=lambda stats: stats['conn_active'])
if 'tcp_hs' in args.kind:
plot(ax, data, label=f'TCP Handshakes ({name})', color='tab:green',
plot(ax, data, label=f'TCP Handshakes ({name})', color=next(COLOR_TCP_HS),
eval_func=lambda stats: stats['conn_handshakes'])
if 'tls_resumed' in args.kind:
plot(ax, data, label=f'TLS Resumed ({name})', color='tab:orange',
plot(ax, data, label=f'TLS Resumed ({name})', color=next(COLOR_TLS_RESUMED),
eval_func=lambda stats: stats['conn_resumed'])
if 'failed_hs' in args.kind:
plot(ax, data, label=f'Failed Handshakes ({name})', color='tab:gray',
plot(ax, data, label=f'Failed Handshakes ({name})', color=next(COLOR_FAILED_HS),
eval_func=lambda stats: stats['conn_handshakes_failed'])
plt.legend()
......
......@@ -42,7 +42,7 @@ def siname(n):
def init_plot(title):
# plt.rcParams["font.family"] = "monospace"
_, ax = plt.subplots(figsize=(8, 8))
_, ax = plt.subplots(figsize=(9, 9))
ax.set_xscale('log')
ax.xaxis.set_major_formatter(mtick.FormatStrFormatter('%s'))
......@@ -152,7 +152,7 @@ def main():
plot_log_percentile_histogram(ax, latency, label)
plt.legend()
plt.savefig(args.output, dpi=300)
plt.savefig(args.output)
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment