Skip to content

Commit

Permalink
Total de verificaçõs de throughput agora é mostrado. Tempo de execuçã…
Browse files Browse the repository at this point in the history
…o aumentado.
  • Loading branch information
Anderson0abr committed Jun 4, 2018
1 parent 8174a6d commit 10bf183
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def l2Proto(pkt):

def throughputMonitor():
print("Starting throughput monitor...")
global bandwidth, throughput_errors, throughput, profile_phase, throughput_list
global bandwidth, throughput_errors, throughput, throughput_check, profile_phase, throughput_list

start_time = pd.Timestamp.now()
while profile_phase:
Expand All @@ -82,6 +82,7 @@ def throughputMonitor():
while True:
time_running = pd.Timestamp.now() - start_time
if time_running >= bandwidth_checktime:
throughput_check += 1
throughput = bandwidth/time_running.total_seconds()
if not (throughput_mean - throughput_deviation < throughput < throughput_mean + throughput_deviation):
throughput_errors += 1
Expand Down Expand Up @@ -143,6 +144,7 @@ def callSolver(msg):
profile_packages = 0
predicted_packages = 0
anomaly_errors = 0
throughput_check = 0

bandwidth = 0.0
bandwidth_checktime = pd.Timedelta('1m')
Expand Down Expand Up @@ -172,7 +174,7 @@ def callSolver(msg):
test_thread.start()
throughput_thread.start()

sniff(iface="root-eth0", filter="ip", prn=createProfile, timeout=pd.Timedelta('10m').total_seconds())
sniff(iface="root-eth0", filter="ip", prn=createProfile, timeout=pd.Timedelta('15m').total_seconds())
#root --> 10.10.10.254
#eth0 --> 10.10.10.10

Expand Down Expand Up @@ -200,10 +202,10 @@ def callSolver(msg):

print("Initializing monitor")

sniff(iface="root-eth0", filter="ip", prn=predict, timeout=pd.Timedelta('20m').total_seconds())
sniff(iface="root-eth0", filter="ip", prn=predict, timeout=pd.Timedelta('45m').total_seconds())
keep_test=False

print("Throughput mean: ", throughput_mean)
print("Throughput standart deviation: ", throughput_deviation)
print("Anomaly errors: {}/{}".format(anomaly_errors, predicted_packages))
print("Throughput errors:", throughput_errors)
print("Throughput errors: {}/{}".format(throughput_errors, throughput_check))

0 comments on commit 10bf183

Please sign in to comment.