Created
August 20, 2012 22:09
-
-
Save arkadius/3408397 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: traffic.c | |
=================================================================== | |
--- traffic.c (wersja 5644) | |
+++ traffic.c (kopia robocza) | |
@@ -131,7 +131,7 @@ | |
void updateDeviceThpt(int deviceToUpdate, int quickUpdate) { | |
int i; | |
- time_t timeDiff, timeMinDiff, timeHourDiff=0, totalTime, when; | |
+ time_t timeDiff, timeMinDiff, time5MinDiff timeHourDiff=0, totalTime, when; | |
HostTraffic *el; | |
short updateMinThpt=0, updateHourThpt=0; | |
TopTalkers lastMinTalkers, lastHourTalkers; | |
@@ -192,10 +192,10 @@ | |
myGlobals.device[deviceToUpdate].lastMinThptUpdate = myGlobals.actTime; | |
} | |
- if((timeMinDiff = myGlobals.actTime-myGlobals.device[deviceToUpdate].lastFiveMinsThptUpdate) >= 300 /* 5 minutes */) { | |
+ if((time5MinDiff = myGlobals.actTime-myGlobals.device[deviceToUpdate].lastFiveMinsThptUpdate) >= 300 /* 5 minutes */) { | |
myGlobals.device[deviceToUpdate].lastFiveMinsEthernetBytes.value = | |
myGlobals.device[deviceToUpdate].ethernetBytes.value - myGlobals.device[deviceToUpdate].lastFiveMinsEthernetBytes.value; | |
- myGlobals.device[deviceToUpdate].lastFiveMinsThptUpdate = timeMinDiff; | |
+ myGlobals.device[deviceToUpdate].lastFiveMinsThptUpdate = time5MinDiff; | |
myGlobals.device[deviceToUpdate].lastFiveMinsThpt = | |
(float)myGlobals.device[deviceToUpdate].lastFiveMinsEthernetBytes.value/ | |
(float)myGlobals.device[deviceToUpdate].lastFiveMinsThptUpdate; | |
@@ -252,9 +252,11 @@ | |
/* 1 Minute Throughput */ | |
if(updateMinThpt) { | |
- el->averageRcvdThpt = (float)(((float)el->bytesRcvdSession.value)/totalTime); | |
- el->averageSentThpt = (float)(((float)el->bytesSentSession.value)/totalTime); | |
+ el->averageRcvdThpt = (float)((float)(el->bytesRcvd.value-el->averageBytesRcvd.value)/timeMinDiff); | |
+ el->averageSentThpt = (float)((float)(el->bytesSent.value-el->averageBytesSent.value)/timeMinDiff); | |
+ el->averageBytesRcvd = el->bytesRcvd, el->averageBytesSent = el->bytesSent; | |
+ | |
updateTopThpt(&lastMinTalkers, el->serialHostIndex, el->averageSentThpt, el->averageRcvdThpt); | |
/* 1 Hour Throughput */ | |
Index: globals-structtypes.h | |
=================================================================== | |
--- globals-structtypes.h (wersja 5644) | |
+++ globals-structtypes.h (kopia robocza) | |
@@ -729,9 +729,9 @@ | |
TrafficCounter pktsBroadcastSent, bytesBroadcastSent; | |
TrafficCounter pktsMulticastSent, bytesMulticastSent; | |
TrafficCounter pktsMulticastRcvd, bytesMulticastRcvd; | |
- TrafficCounter lastBytesSent, lastHourBytesSent; | |
+ TrafficCounter lastBytesSent, averageBytesSent, lastHourBytesSent; | |
TrafficCounter bytesSent, bytesSentLoc, bytesSentRem, bytesSentSession; | |
- TrafficCounter lastBytesRcvd, lastHourBytesRcvd, bytesRcvd; | |
+ TrafficCounter lastBytesRcvd, averageBytesRcvd, lastHourBytesRcvd, bytesRcvd; | |
TrafficCounter bytesRcvdLoc, bytesRcvdFromRem, bytesRcvdSession; | |
float actualRcvdThpt, lastHourRcvdThpt, averageRcvdThpt, peakRcvdThpt; | |
float actualSentThpt, lastHourSentThpt, averageSentThpt, peakSentThpt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment