aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring
diff options
context:
space:
mode:
authorMelanie2013-07-24 04:45:07 +0100
committerMelanie2013-07-24 04:45:07 +0100
commite82d4154a2e348e4a38f01cb1877878c94569bba (patch)
tree7b27e6d30d04f6089fd17d5779cfb0a81e50d508 /OpenSim/Framework/Monitoring
parentMerge branch 'master' into careminster (diff)
parentFor unknown user issue, bump GUN7 to GUN8 and UMMAU3 to UMMAU4 to assess what... (diff)
downloadopensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.zip
opensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.tar.gz
opensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.tar.bz2
opensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs OpenSim/Region/Physics/Manager/PhysicsActor.cs OpenSim/Region/Physics/Manager/PhysicsScene.cs
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-rw-r--r--OpenSim/Framework/Monitoring/Stats/Stat.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs
index 9629b6e..ffd5132 100644
--- a/OpenSim/Framework/Monitoring/Stats/Stat.cs
+++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs
@@ -225,7 +225,13 @@ namespace OpenSim.Framework.Monitoring
225 public virtual string ToConsoleString() 225 public virtual string ToConsoleString()
226 { 226 {
227 StringBuilder sb = new StringBuilder(); 227 StringBuilder sb = new StringBuilder();
228 sb.AppendFormat("{0}.{1}.{2} : {3} {4}", Category, Container, ShortName, Value, UnitName); 228 sb.AppendFormat(
229 "{0}.{1}.{2} : {3}{4}",
230 Category,
231 Container,
232 ShortName,
233 Value,
234 UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName));
229 235
230 AppendMeasuresOfInterest(sb); 236 AppendMeasuresOfInterest(sb);
231 237
@@ -253,6 +259,8 @@ namespace OpenSim.Framework.Monitoring
253 == MeasuresOfInterest.AverageChangeOverTime) 259 == MeasuresOfInterest.AverageChangeOverTime)
254 { 260 {
255 double totalChange = 0; 261 double totalChange = 0;
262 double lastChangeOverTime = 0;
263 double? penultimateSample = null;
256 double? lastSample = null; 264 double? lastSample = null;
257 265
258 lock (m_samples) 266 lock (m_samples)
@@ -266,13 +274,25 @@ namespace OpenSim.Framework.Monitoring
266 if (lastSample != null) 274 if (lastSample != null)
267 totalChange += s - (double)lastSample; 275 totalChange += s - (double)lastSample;
268 276
277 penultimateSample = lastSample;
269 lastSample = s; 278 lastSample = s;
270 } 279 }
271 } 280 }
272 281
282 if (lastSample != null && penultimateSample != null)
283 lastChangeOverTime
284 = ((double)lastSample - (double)penultimateSample) / (Watchdog.WATCHDOG_INTERVAL_MS / 1000);
285
273 int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1; 286 int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1;
274 287
275 sb.AppendFormat(", {0:0.##} {1}/s", totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000), UnitName); 288 double averageChangeOverTime = totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000);
289
290 sb.AppendFormat(
291 ", {0:0.##}{1}/s, {2:0.##}{3}/s",
292 lastChangeOverTime,
293 UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName),
294 averageChangeOverTime,
295 UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName));
276 } 296 }
277 } 297 }
278 } 298 }