Updated colors and added date generated to graphs

master
Nixellion 2020-07-20 15:41:57 +03:00
parent f9146669ec
commit 1052191aae
2 changed files with 11 additions and 6 deletions

View File

@ -5,13 +5,15 @@ database_migrate: false
good_speed_mbps: 8 good_speed_mbps: 8
output_image_path: /var/www/downloads/speedgraph_{}.png output_image_path: /var/www/downloads/speedgraph_{}.png
output_txt_path: /var/www/downloads/speeds.txt output_txt_path: /var/www/downloads/speeds.txt
#output_image_path: E:\Nextcloud\Projects\Python\BroSpeedTester\speedgraph_{}.png
#output_txt_path: E:\Nextcloud\Projects\Python\BroSpeedTester\speeds.txt
ros_du_invert: True ros_du_invert: True
ros_dynamic_speed: true ros_dynamic_speed: true
ros_fasttrack_comment: 'defconf: fasttrack' ros_fasttrack_comment: 'defconf: fasttrack'
ros_ip: 192.168.88.1 ros_ip: 192.168.88.1
ros_maximum_speed: 15000000 ros_maximum_speed: 15000000
ros_minimum_speed: 100000 ros_minimum_speed: 100000
speedtest_threads: 2 speedtest_threads: 4
speedtest_master_threads: 4 speedtest_master_threads: 4
ros_queues: ros_queues:
- eth_LTE6_1 - eth_LTE6_1

View File

@ -47,10 +47,12 @@ def generate_plot_image(dates, downloads, uploads, name="speed", description="Sp
log.debug("Genering image output for {}...".format(name)) log.debug("Genering image output for {}...".format(name))
dates = matplotlib.dates.date2num(dates) dates = matplotlib.dates.date2num(dates)
plt.style.use('dark_background')
fig = plt.figure(figsize=(15, 3)) fig = plt.figure(figsize=(15, 3))
plt.plot_date(dates, downloads, linestyle='solid', color="red", linewidth=2, marker=None) plt.plot_date(dates, uploads, linestyle='dashed', color="#2b4f72", linewidth=1, marker=None)
plt.plot_date(dates, uploads, linestyle='dashed', color="green", linewidth=0.5, marker=None) plt.plot_date(dates, downloads, linestyle='solid', color="#14fc1b", linewidth=2, marker=None)
plt.ylabel(description + " (Mbps)") plt.ylabel(description + " (Mbps)")
plt.xlabel("Generated at: " + datetime.now().strftime('%H:%M %d.%m.%Y'))
plt.tight_layout() plt.tight_layout()
plt.savefig(read_config()['output_image_path'].format(name)) plt.savefig(read_config()['output_image_path'].format(name))
@ -476,9 +478,10 @@ if __name__ == "__main__":
Once finished it will also generate an image with graph plotted. Once finished it will also generate an image with graph plotted.
''' '''
# generate_plot_image(*gather_data()) generate_plot_image(*gather_data())
# import sys import sys
# sys.exit()
sys.exit()
from random import uniform from random import uniform
try: try: