文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Comparision
import pandas as pd
import seaborn as sns
%pylab inline
Populating the interactive namespace from numpy and matplotlib
consumer_df = pd.DataFrame.from_dict(consumer_timings, orient='index').rename(columns={0: 'time_in_seconds'})
producer_df = pd.DataFrame.from_dict(producer_timings, orient='index').rename(columns={0: 'time_in_seconds'})
consumer_df['MBs/s'] = (len(msg_payload) * msg_count) / consumer_df.time_in_seconds / (1024*1024)
producer_df['MBs/s'] = (len(msg_payload) * msg_count) / producer_df.time_in_seconds / (1024*1024)
consumer_df['Msgs/s'] = msg_count / consumer_df.time_in_seconds
producer_df['Msgs/s'] = msg_count / producer_df.time_in_seconds
producer_df.sort_index(inplace=True)
producer_df
time_in_seconds | MBs/s | Msgs/s |
---|---|---|
confluent_kafka_producer | 5.450890 | 17.495754 |
pykafka_producer | 57.318527 | 1.663815 |
pykafka_producer_rdkafka | 15.724413 | 6.064928 |
python_kafka_producer | 67.855882 | 1.405441 |
consumer_df.sort_index(inplace=True)
consumer_df
time_in_seconds | MBs/s | Msgs/s |
---|---|---|
confluent_kafka_consumer | 3.825439 | 24.929801 |
pykafka_consumer | 29.431728 | 3.240293 |
pykafka_consumer_rdkafka | 6.086001 | 15.669966 |
python_kafka_consumer | 26.547753 | 3.592298 |
producer_df.plot(kind='bar', subplots=True, figsize=(10, 10), title="Producer Comparison")
array([<matplotlib.axes._subplots.AxesSubplot object at 0x7f8ef4e2edd8>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f8ef2978940>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f8ef293c240>], dtype=object)
consumer_df.plot(kind='bar', subplots=True, figsize=(10, 10), title="Consumer Comparison")
array([<matplotlib.axes._subplots.AxesSubplot object at 0x7f8ef286c048>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f8ef2855908>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f8ef27a4080>], dtype=object)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论