mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-12-24 14:27:18 +00:00
Create csv_to_grafana.py and build dependencies
Signed-off-by: Matthew Stidham <stidmatt@protonmail.com>
This commit is contained in:
@@ -75,9 +75,7 @@ class CSVtoInflux(Realm):
|
||||
date = datetime.datetime.utcfromtimestamp(int(date) / 1000).isoformat() #convert to datetime so influx can read it, this is required
|
||||
numeric_score = line[numeric_score_index]
|
||||
numeric_score = float(numeric_score) #convert to float, InfluxDB cannot
|
||||
test_details = line[test_details_index]
|
||||
short_description = line[short_description_index]
|
||||
test_id = line[test_id_index]
|
||||
tags = dict()
|
||||
tags['script'] = line[test_id_index]
|
||||
tags['short-description'] = line[short_description_index]
|
||||
@@ -92,6 +90,21 @@ class CSVtoInflux(Realm):
|
||||
# variable n ame, value, tags, date
|
||||
# total-download-mbps-speed-for-the-duration-of-this-iteration 171.085494 {'script': 'WiFi Capacity'} 2021-04-14T19:04:04.902000
|
||||
|
||||
def script_name(self):
|
||||
with open(self.target_csv) as fp:
|
||||
line = fp.readline()
|
||||
line = line.split('\t')
|
||||
test_id_index = line.index('test-id')
|
||||
line = fp.readline()
|
||||
return line[test_id_index]
|
||||
|
||||
|
||||
def create_dashboard(self,
|
||||
dashboard_name=None):
|
||||
#Create a dashboard in Grafana to look at the data you just posted to Influx
|
||||
dashboard_name
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
lfjson_host = "localhost"
|
||||
|
||||
Reference in New Issue
Block a user