mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
merge conflict fix
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
54
py-scripts/sandbox/kpi_3.py
Normal file
54
py-scripts/sandbox/kpi_3.py
Normal file
@@ -0,0 +1,54 @@
|
||||
# Run this app with `python app.py` and
|
||||
# visit http://127.0.0.1:8050/ in your web browser.
|
||||
|
||||
import dash
|
||||
import dash_core_components as dcc
|
||||
import dash_html_components as html
|
||||
import plotly.express as px
|
||||
import pandas as pd
|
||||
|
||||
|
||||
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
|
||||
|
||||
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
|
||||
|
||||
df = pd.read_csv('http://192.168.95.6/html-reports/2021-07-20-16-25-05_lf_check/dataplane-2021-07-20-04-28-42/kpi.csv', sep='\t')
|
||||
|
||||
append_df = pd.read_csv('http://192.168.95.6/html-reports/2021-07-24-03-00-01_lf_check/dataplane-2021-07-24-03-06-02/kpi.csv', sep='\t')
|
||||
|
||||
df = df.append(append_df, ignore_index=True)
|
||||
|
||||
#print(df)
|
||||
|
||||
fig = (px.scatter(df, x="Date", y="numeric-score",
|
||||
color="short-description", hover_name="short-description",
|
||||
size_max=60)).update_traces(mode='lines+markers')
|
||||
|
||||
'''
|
||||
fig = px.scatter(df, x="Date", y="numeric-score",
|
||||
color="short-description", hover_name="short-description",
|
||||
size_max=60)
|
||||
'''
|
||||
'''
|
||||
fig = px.scatter(df, x="short-description", y="numeric-score",
|
||||
color="short-description", hover_name="short-description",
|
||||
size_max=60)
|
||||
'''
|
||||
fig .update_layout(
|
||||
title="Throughput vs Packet size",
|
||||
xaxis_title="Packet Size",
|
||||
yaxis_title="Mbps",
|
||||
xaxis = {'type' : 'date'}
|
||||
)
|
||||
|
||||
|
||||
app.layout = html.Div([
|
||||
dcc.Graph(
|
||||
id='packet-size vs rate',
|
||||
figure=fig
|
||||
)
|
||||
])
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run_server(debug=True)
|
||||
|
||||
94
py-scripts/sandbox/lf_json_autogen_test.py
Normal file
94
py-scripts/sandbox/lf_json_autogen_test.py
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
'''
|
||||
NAME:
|
||||
lf_json_test.py
|
||||
|
||||
PURPOSE:
|
||||
|
||||
|
||||
EXAMPLE:
|
||||
./lf_json_test.py -
|
||||
|
||||
NOTES:
|
||||
|
||||
|
||||
TO DO NOTES:
|
||||
|
||||
|
||||
'''
|
||||
import os
|
||||
import sys
|
||||
if sys.version_info[0] != 3:
|
||||
print("This script requires Python3")
|
||||
exit()
|
||||
|
||||
|
||||
from time import sleep
|
||||
import argparse
|
||||
import json
|
||||
#if 'py-json' not in sys.path:
|
||||
# sys.path.append(os.path.join(os.path.abspath('..'), 'py-json'))
|
||||
# print("path: {}".format(os.path.join(os.path.abspath('..'))))
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append(os.path.join(os.path.abspath('..'), 'py-json'))
|
||||
|
||||
from LANforge import lf_json_autogen
|
||||
|
||||
class lf_read_json():
|
||||
def __init__(self):
|
||||
|
||||
self.timeout = 10
|
||||
|
||||
|
||||
def preprocess_data(self):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
# arguments
|
||||
parser = argparse.ArgumentParser(
|
||||
prog='lf_json_test.py',
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
epilog='''\
|
||||
lf_json_test.py : lf json test
|
||||
''',
|
||||
description='''\
|
||||
lf_json_test.py
|
||||
-----------
|
||||
|
||||
Summary :
|
||||
---------
|
||||
|
||||
|
||||
./lf_dataplane_json.py --mgr 192.168.0.101 --port 8080 --lf_user lanforge --lf_password lanforge --instance_name dataplane-instance --config_name test_con --upstream 1.1.eth1 --dut asus_5g --duration 15s --station 1.1.13.sta0002 --download_speed 85% --upload_speed 0 --raw_line 'pkts: Custom;60;MTU' --raw_line 'cust_pkt_sz: 88 1200' --raw_line 'directions: DUT Transmit' --raw_line 'traffic_types: UDP' --raw_line 'bandw_options: 20' --raw_line 'spatial_streams: 1
|
||||
|
||||
''')
|
||||
|
||||
#parser.add_argument('--json', help="--json <config.json> json input file", default="config.json")
|
||||
parser.add_argument('--cmd', help="--cmd <json_cmd> json command", default="")
|
||||
args = parser.parse_args()
|
||||
json_cmd = args.cmd
|
||||
print("json cmd {}".format(json_cmd))
|
||||
#with open(config_json, 'r') as config_file:
|
||||
# config_data = json.load(config_file)
|
||||
#print(config_data)
|
||||
|
||||
lf_get = lf_json_autogen.LFJsonGet(lfclient_host='192.168.0.101',
|
||||
lfclient_port=8080,
|
||||
debug_=True,
|
||||
)
|
||||
|
||||
duts = lf_get.get_chamber(fields = [lf_get.duts])
|
||||
print("duts {}".format(duts))
|
||||
|
||||
|
||||
|
||||
|
||||
print("END lf_read_json.py")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user