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

@ -1,15 +1,5 @@
#!/bin/bash #!/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 () function writeMariaDB ()
{ {
echo "write data to mariadb" echo "write data to mariadb"
@ -24,7 +14,6 @@ function runTest ()
bat speedtest.tmp bat speedtest.tmp
# write output to db # write output to db
# writeSqlite3
writeMariaDB writeMariaDB
# write output to csv # write output to csv