aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/Stats/Stat.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs
index 9629b6e..cc2c947 100644
--- a/OpenSim/Framework/Monitoring/Stats/Stat.cs
+++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs
@@ -253,6 +253,8 @@ namespace OpenSim.Framework.Monitoring
253 == MeasuresOfInterest.AverageChangeOverTime) 253 == MeasuresOfInterest.AverageChangeOverTime)
254 { 254 {
255 double totalChange = 0; 255 double totalChange = 0;
256 double lastChangeOverTime = 0;
257 double? penultimateSample = null;
256 double? lastSample = null; 258 double? lastSample = null;
257 259
258 lock (m_samples) 260 lock (m_samples)
@@ -266,13 +268,21 @@ namespace OpenSim.Framework.Monitoring
266 if (lastSample != null) 268 if (lastSample != null)
267 totalChange += s - (double)lastSample; 269 totalChange += s - (double)lastSample;
268 270
271 penultimateSample = lastSample;
269 lastSample = s; 272 lastSample = s;
270 } 273 }
271 } 274 }
272 275
276 if (lastSample != null && penultimateSample != null)
277 lastChangeOverTime = (double)lastSample - (double)penultimateSample;
278
273 int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1; 279 int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1;
274 280
275 sb.AppendFormat(", {0:0.##} {1}/s", totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000), UnitName); 281 double averageChangeOverTime = totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000);
282
283 sb.AppendFormat(
284 ", {0:0.##} {1}/s, {2:0.##} {3}/s",
285 lastChangeOverTime, UnitName, averageChangeOverTime, UnitName);
276 } 286 }
277 } 287 }
278 } 288 }