Updated colors and added date generated to graphs
							parent
							
								
									f9146669ec
								
							
						
					
					
						commit
						1052191aae
					
				| 
						 | 
				
			
			@ -5,13 +5,15 @@ database_migrate: false
 | 
			
		|||
good_speed_mbps: 8
 | 
			
		||||
output_image_path: /var/www/downloads/speedgraph_{}.png
 | 
			
		||||
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_dynamic_speed: true
 | 
			
		||||
ros_fasttrack_comment: 'defconf: fasttrack'
 | 
			
		||||
ros_ip: 192.168.88.1
 | 
			
		||||
ros_maximum_speed: 15000000
 | 
			
		||||
ros_minimum_speed: 100000
 | 
			
		||||
speedtest_threads: 2
 | 
			
		||||
speedtest_threads: 4
 | 
			
		||||
speedtest_master_threads: 4
 | 
			
		||||
ros_queues:
 | 
			
		||||
  - eth_LTE6_1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,10 +47,12 @@ def generate_plot_image(dates, downloads, uploads, name="speed", description="Sp
 | 
			
		|||
    log.debug("Genering image output for {}...".format(name))
 | 
			
		||||
 | 
			
		||||
    dates = matplotlib.dates.date2num(dates)
 | 
			
		||||
    plt.style.use('dark_background')
 | 
			
		||||
    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="green", linewidth=0.5, marker=None)
 | 
			
		||||
    plt.plot_date(dates, uploads, linestyle='dashed', color="#2b4f72", linewidth=1, marker=None)
 | 
			
		||||
    plt.plot_date(dates, downloads, linestyle='solid', color="#14fc1b", linewidth=2, marker=None)
 | 
			
		||||
    plt.ylabel(description + " (Mbps)")
 | 
			
		||||
    plt.xlabel("Generated at: " + datetime.now().strftime('%H:%M %d.%m.%Y'))
 | 
			
		||||
    plt.tight_layout()
 | 
			
		||||
    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.
 | 
			
		||||
    '''
 | 
			
		||||
 | 
			
		||||
    # generate_plot_image(*gather_data())
 | 
			
		||||
    # import sys
 | 
			
		||||
    # sys.exit()
 | 
			
		||||
    generate_plot_image(*gather_data())
 | 
			
		||||
    import sys
 | 
			
		||||
 | 
			
		||||
    sys.exit()
 | 
			
		||||
    from random import uniform
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue