143 var startTime = DateTime.MinValue;
145 var firstTime = DateTime.MinValue;
146 long firstReceived = 0;
147 long firstIgnored = 0;
148 long firstDropped = 0;
150 long firstNotSent = 0;
152 var lastTime = DateTime.MinValue;
153 long lastReceived = 0;
154 long lastIgnored = 0;
155 long lastDropped = 0;
157 long lastNotSent = 0;
159 bool firstRun =
true;
163 foreach (var reading
in dataMapper)
165 bool readNext =
false;
167 ? reading.RoundedLocalTime
168 : reading.RoundedUtcTime;
172 double minutes = readingTime.Subtract(lastTime).TotalMinutes;
173 double totalMinutes = readingTime.Subtract(firstTime).TotalMinutes;
174 double minutesSinceReset = readingTime.Subtract(startTime).TotalMinutes;
176 if (minutes >= interval)
178 time.Add(readingTime);
183 sent.Add((reading.PacketsSent - lastSent)*
config.
Sent/minutes/disFactor ?? 0.0);
223 int hours = reading.TimeSinceReset/(60*60);
224 int mins = (reading.TimeSinceReset - hours*60*60)/60;
225 int seconds = reading.TimeSinceReset - hours*60*60 - mins*60;
226 var span =
new TimeSpan(hours, mins, seconds);
227 startTime = readingTime.Subtract(span);
229 firstTime = readingTime;
230 firstReceived = reading.ReceivedPackets;
231 firstIgnored = reading.IgnoredPackets;
232 firstDropped = reading.DroppedPackets;
233 firstSent = reading.PacketsSent;
234 firstNotSent = reading.PacketsNotSent;
237 if (firstRun || readNext)
239 lastTime = readingTime;
240 lastReceived = reading.ReceivedPackets;
241 lastIgnored = reading.IgnoredPackets;
242 lastDropped = reading.DroppedPackets;
243 lastSent = reading.PacketsSent;
244 lastNotSent = reading.PacketsNotSent;
readonly List< DateTime > time
DateTime FilterTime
Gets or sets the time to use when extracting data. Only readings with a timestamp later than FilterTi...
Host FilterHost
Gets or sets the host
readonly List< double > notSent
readonly List< double > notSentAvg
readonly ITrafficGraphConfiguration config
readonly List< double > ignored
readonly List< double > receivedAvg
Singleton facade class used to access memory persistent data.
readonly List< double > received
readonly List< double > receivedAvgTot
static DataFace Instance
Gets the Singleton instance.
readonly List< double > ignoredAvg
readonly List< double > sentAvg
readonly List< double > dropped
readonly List< double > sent
readonly List< double > droppedAvg
HostIoReadingDatabaseMapper HostIoReadings
Gets the host IO reading mapper.