mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	get_milliseconds function
This commit is contained in:
		@@ -8,9 +8,10 @@ from pprint import pprint
 | 
			
		||||
import time
 | 
			
		||||
import random
 | 
			
		||||
import string
 | 
			
		||||
import datetime
 | 
			
		||||
import argparse
 | 
			
		||||
import LANforge.LFUtils
 | 
			
		||||
from LANforge.LFUtils import *
 | 
			
		||||
import argparse
 | 
			
		||||
from LANforge import LFRequest
 | 
			
		||||
import LANforge.LFRequest
 | 
			
		||||
 | 
			
		||||
@@ -550,6 +551,10 @@ class LFCliBase:
 | 
			
		||||
            chars = string.ascii_letters
 | 
			
		||||
        return ''.join(random.choice(chars) for x in range(size))
 | 
			
		||||
 | 
			
		||||
    def get_milliseconds(self,
 | 
			
		||||
                         timestamp):
 | 
			
		||||
        return (timestamp - datetime.datetime(1970,1,1)).total_seconds()*1000
 | 
			
		||||
 | 
			
		||||
    Help_Mode = """Station WiFi modes: use the number value below:
 | 
			
		||||
                auto   : 0,
 | 
			
		||||
                a      : 1,
 | 
			
		||||
 
 | 
			
		||||
@@ -1249,14 +1249,14 @@ class L3CXProfile(LFCliBase):
 | 
			
		||||
        header_row.append('Timestamp milliseconds')
 | 
			
		||||
        df = pd.DataFrame(full_test_data_list)
 | 
			
		||||
 | 
			
		||||
        df["Timestamp milliseconds"] = (df["Timestamp"] - datetime.datetime(1970,1,1)).dt.total_seconds()*1000
 | 
			
		||||
        df["Timestamp milliseconds"] = [self.get_milliseconds(x) for x in df["Timestamp"]]
 | 
			
		||||
        #round entire column
 | 
			
		||||
        df["Timestamp milliseconds"]=df["Timestamp milliseconds"].astype(int)
 | 
			
		||||
        df["Timestamp"]=df["Timestamp"].apply(lambda x:x.strftime("%m/%d/%Y %I:%M:%S"))
 | 
			
		||||
        df=df[["Timestamp","Timestamp milliseconds", *header_row[:-2]]]
 | 
			
		||||
        #compare previous data to current data
 | 
			
		||||
 | 
			
		||||
        systeminfo = ast.literal_eval(requests.get('http://'+str(self.lfclient_host)+':'+str(self.lfclient_port)).text)
 | 
			
		||||
        systeminfo = self.json_get('/')
 | 
			
		||||
 | 
			
		||||
        df['LFGUI Release'] = systeminfo['VersionInfo']['BuildVersion']
 | 
			
		||||
        df['Script Name'] = script_name
 | 
			
		||||
@@ -1772,7 +1772,7 @@ class L4CXProfile(LFCliBase):
 | 
			
		||||
        header_row.append('Timestamp milliseconds')
 | 
			
		||||
        df = pd.DataFrame(full_test_data_list)
 | 
			
		||||
 | 
			
		||||
        df["Timestamp milliseconds"] = (df["Timestamp"] - datetime.datetime(1970,1,1)).dt.total_seconds()*1000
 | 
			
		||||
        df["Timestamp milliseconds"] = [self.get_milliseconds(x) for x in df["Timestamp"]]
 | 
			
		||||
        #round entire column
 | 
			
		||||
        df["Timestamp milliseconds"]=df["Timestamp milliseconds"].astype(int)
 | 
			
		||||
        df["Timestamp"]=df["Timestamp"].apply(lambda x:x.strftime("%m/%d/%Y %I:%M:%S"))
 | 
			
		||||
 
 | 
			
		||||
@@ -258,7 +258,7 @@ python3 ./test_ipv4_variable_time.py
 | 
			
		||||
        optional_args.add_argument('--a_min', help='--a_min bps rate minimum for side_a', default=256000)
 | 
			
		||||
        optional_args.add_argument('--b_min', help='--b_min bps rate minimum for side_b', default=256000)
 | 
			
		||||
        optional_args.add_argument('--test_duration', help='--test_duration sets the duration of the test', default="2m")
 | 
			
		||||
        optional_args.add_argument('--col_names', help='Columns wished to be monitor',default=None)
 | 
			
		||||
        optional_args.add_argument('--col_names', help='Columns wished to be monitor', default=None)
 | 
			
		||||
        optional_args.add_argument('--compared_report',help='report path and file which is wished to be compared with new report', default=None)
 | 
			
		||||
    args = parser.parse_args()
 | 
			
		||||
    #['name','tx bytes', 'rx bytes','dropped']
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user