show i in output

master
DJh2o2 2022-08-09 08:04:58 +07:00
commit c40f378a55
2 changed files with 6 additions and 19 deletions

@ -1,6 +1,10 @@
import matplotlib.pyplot as plt
import mysql.connector
# matplotlib.use('tkAgg')
def Average(lst):
return sum(lst) / len(lst)
# mariadb
mariadbConnection = mysql.connector.connect(
@ -21,13 +25,7 @@ for i in mariadbResult:
downloads.append(i[2])
uploads.append(i[3])
# Python program to get average of a list
def Average(lst):
return sum(lst) / len(lst)
print("i = ", len(times))
print("avg ping = ", Average(pings), " ms")
print("avg download = ", Average(downloads) / 1000000, " mbit/s")
print("avg upload = ", Average(uploads) / 1000000, " mbit/s")

@ -1,15 +1,5 @@
#!/bin/bash
# function writeSqlite3 ()
# {
# # now import the csv data in to sqlite db
# echo "write data to sqlite3"
# sqlite3 -batch bandwidth.db <<"EOF"
# .separator ","
# .import speedtest.tmp bandwidth
# EOF
# }
function writeMariaDB ()
{
echo "write data to mariadb"
@ -24,7 +14,6 @@ function runTest ()
bat speedtest.tmp
# write output to db
# writeSqlite3
writeMariaDB
# write output to csv