Last active
January 30, 2018 21:05
-
-
Save davipatti/c2a381f6af93138c72d8e476fee0542e to your computer and use it in GitHub Desktop.
Run internet speed test every 20 mins. Log the results and plot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/bin/speedtest-cli --csv > ~/.speedtest.log.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/sivel/speedtest-cli | |
pip install speedtest-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
sns.set_style("darkgrid") | |
df = pd.read_csv(sys.stdin, index_col=3, parse_dates=[3, ]) | |
df.loc[:, "Download"] /= 1e6 | |
df.loc[:, "Upload"] /= 1e6 | |
df.plot(y=["Download", "Upload"], figsize=(8, 5)) | |
plt.ylabel("Mbit/s") | |
plt.savefig("download-upload-speed.png", bbox_inches="tight") | |
plt.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0,20,40 * * * * /usr/local/bin/speedtest-cli --csv >> ~/.speedtest.log.csv 2> /dev/null | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment