<jupyter_start><jupyter_text>Analyze the Benchmarking of Socket Server/Client<jupyter_code>import json
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use(['fivethirtyeight'])
with open('../benchmarks/socket_server/aws_c5n.2xlarge_2020_04_12.json') as fp:
    unstructed = json.load(fp)
assert unstructed['duration'] == 'PT3S'
duration_seconds = 3
results = pd.DataFrame(unstructed['results'])
results.head()
len(results)
agg_results = results.groupby(['serverThreads', 'clientThreads'])['messages'].describe()
agg_results.head()
x = agg_results.div(1000).div(duration_seconds).sort_values('50%')
display(x.tail().iloc[::-1])
iq = x[['25%', '75%']].copy()
iq['25%'] = x['50%'] - iq['25%']
iq['75%'] -= x['50%']
x.plot.barh(figsize=(9, 12), y='50%', xerr=iq.values.T,
            error_kw=dict(ecolor='black', lw=1.5, capsize=4, capthick=1.5))
plt.gca().get_legend().remove()
plt.xlabel('Requests per a Second (1000s)')
plt.title('Benchmarking of Simple TCP Server for Three Seconds')
del x<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1936108422071636, 'fraction_numerical': 0.04549854791868345, 'mean_word_length': 6.774436090225564, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '621248', 'license': 'Apache-2.0', 'n_tokens_mistral': 426, 'n_tokens_neox': 393, 'n_words': 70, 'path': 'benchmark_socket_server.ipynb', 'repo_name': 'DBFromZero/dbf0analysis', 'size': '1033'}