diff options
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-rw-r--r-- | OpenSim/Framework/Monitoring/BaseStatsCollector.cs | 21 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/ServerStatsCollector.cs | 43 | ||||
-rwxr-xr-x | OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | 28 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Stats/Stat.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 6 |
6 files changed, 97 insertions, 18 deletions
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index 20495f6..96536e8 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |||
@@ -43,7 +43,6 @@ namespace OpenSim.Framework.Monitoring | |||
43 | StringBuilder sb = new StringBuilder(Environment.NewLine); | 43 | StringBuilder sb = new StringBuilder(Environment.NewLine); |
44 | sb.Append("MEMORY STATISTICS"); | 44 | sb.Append("MEMORY STATISTICS"); |
45 | sb.Append(Environment.NewLine); | 45 | sb.Append(Environment.NewLine); |
46 | |||
47 | sb.AppendFormat( | 46 | sb.AppendFormat( |
48 | "Heap allocated to OpenSim : {0} MB\n", | 47 | "Heap allocated to OpenSim : {0} MB\n", |
49 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); | 48 | Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); |
@@ -56,9 +55,23 @@ namespace OpenSim.Framework.Monitoring | |||
56 | "Average heap allocation rate: {0} MB/s\n", | 55 | "Average heap allocation rate: {0} MB/s\n", |
57 | Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3)); | 56 | Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3)); |
58 | 57 | ||
59 | sb.AppendFormat( | 58 | Process myprocess = Process.GetCurrentProcess(); |
60 | "Process memory : {0} MB\n", | 59 | if (!myprocess.HasExited) |
61 | Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0)); | 60 | { |
61 | myprocess.Refresh(); | ||
62 | sb.AppendFormat( | ||
63 | "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | ||
64 | Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0), | ||
65 | Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0), | ||
66 | Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0)); | ||
67 | sb.AppendFormat( | ||
68 | "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n", | ||
69 | Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0), | ||
70 | Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0), | ||
71 | Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0)); | ||
72 | } | ||
73 | else | ||
74 | sb.Append("Process reported as Exited \n"); | ||
62 | 75 | ||
63 | return sb.ToString(); | 76 | return sb.ToString(); |
64 | } | 77 | } |
diff --git a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs index 77315bb..be4a8b4 100644 --- a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs | |||
@@ -249,6 +249,49 @@ namespace OpenSim.Framework.Monitoring | |||
249 | (s) => { s.Value = Math.Round(MemoryWatchdog.LastHeapAllocationRate * 1000d / 1024d / 1024d, 3); }); | 249 | (s) => { s.Value = Math.Round(MemoryWatchdog.LastHeapAllocationRate * 1000d / 1024d / 1024d, 3); }); |
250 | MakeStat("AverageHeapAllocationRate", null, "MB/sec", ContainerMemory, | 250 | MakeStat("AverageHeapAllocationRate", null, "MB/sec", ContainerMemory, |
251 | (s) => { s.Value = Math.Round(MemoryWatchdog.AverageHeapAllocationRate * 1000d / 1024d / 1024d, 3); }); | 251 | (s) => { s.Value = Math.Round(MemoryWatchdog.AverageHeapAllocationRate * 1000d / 1024d / 1024d, 3); }); |
252 | |||
253 | MakeStat("ProcessResident", null, "MB", ContainerProcess, | ||
254 | (s) => | ||
255 | { | ||
256 | Process myprocess = Process.GetCurrentProcess(); | ||
257 | myprocess.Refresh(); | ||
258 | s.Value = Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0); | ||
259 | }); | ||
260 | MakeStat("ProcessPaged", null, "MB", ContainerProcess, | ||
261 | (s) => | ||
262 | { | ||
263 | Process myprocess = Process.GetCurrentProcess(); | ||
264 | myprocess.Refresh(); | ||
265 | s.Value = Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0); | ||
266 | }); | ||
267 | MakeStat("ProcessVirtual", null, "MB", ContainerProcess, | ||
268 | (s) => | ||
269 | { | ||
270 | Process myprocess = Process.GetCurrentProcess(); | ||
271 | myprocess.Refresh(); | ||
272 | s.Value = Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0); | ||
273 | }); | ||
274 | MakeStat("PeakProcessResident", null, "MB", ContainerProcess, | ||
275 | (s) => | ||
276 | { | ||
277 | Process myprocess = Process.GetCurrentProcess(); | ||
278 | myprocess.Refresh(); | ||
279 | s.Value = Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0); | ||
280 | }); | ||
281 | MakeStat("PeakProcessPaged", null, "MB", ContainerProcess, | ||
282 | (s) => | ||
283 | { | ||
284 | Process myprocess = Process.GetCurrentProcess(); | ||
285 | myprocess.Refresh(); | ||
286 | s.Value = Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0); | ||
287 | }); | ||
288 | MakeStat("PeakProcessVirtual", null, "MB", ContainerProcess, | ||
289 | (s) => | ||
290 | { | ||
291 | Process myprocess = Process.GetCurrentProcess(); | ||
292 | myprocess.Refresh(); | ||
293 | s.Value = Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0); | ||
294 | }); | ||
252 | } | 295 | } |
253 | 296 | ||
254 | // Notes on performance counters: | 297 | // Notes on performance counters: |
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index e4df7ee..08c2409 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | |||
@@ -34,6 +34,7 @@ using OpenMetaverse; | |||
34 | using OpenMetaverse.StructuredData; | 34 | using OpenMetaverse.StructuredData; |
35 | using OpenSim.Framework.Monitoring.Interfaces; | 35 | using OpenSim.Framework.Monitoring.Interfaces; |
36 | 36 | ||
37 | |||
37 | namespace OpenSim.Framework.Monitoring | 38 | namespace OpenSim.Framework.Monitoring |
38 | { | 39 | { |
39 | /// <summary> | 40 | /// <summary> |
@@ -71,6 +72,11 @@ namespace OpenSim.Framework.Monitoring | |||
71 | private volatile float pendingDownloads; | 72 | private volatile float pendingDownloads; |
72 | private volatile float pendingUploads; | 73 | private volatile float pendingUploads; |
73 | private volatile float activeScripts; | 74 | private volatile float activeScripts; |
75 | private volatile float spareTime; | ||
76 | private volatile float sleepTime; | ||
77 | private volatile float physicsStep; | ||
78 | |||
79 | |||
74 | private volatile float scriptLinesPerSecond; | 80 | private volatile float scriptLinesPerSecond; |
75 | private volatile float m_frameDilation; | 81 | private volatile float m_frameDilation; |
76 | private volatile float m_usersLoggingIn; | 82 | private volatile float m_usersLoggingIn; |
@@ -253,7 +259,7 @@ namespace OpenSim.Framework.Monitoring | |||
253 | /// <param name="pack"></param> | 259 | /// <param name="pack"></param> |
254 | public void ReceiveClassicSimStatsPacket(SimStats stats) | 260 | public void ReceiveClassicSimStatsPacket(SimStats stats) |
255 | { | 261 | { |
256 | // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original | 262 | // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original |
257 | // SimStatsPacket that was being used). | 263 | // SimStatsPacket that was being used). |
258 | 264 | ||
259 | // For an unknown reason the original designers decided not to | 265 | // For an unknown reason the original designers decided not to |
@@ -270,8 +276,8 @@ namespace OpenSim.Framework.Monitoring | |||
270 | totalFrameTime = stats.StatsBlock[8].StatValue; | 276 | totalFrameTime = stats.StatsBlock[8].StatValue; |
271 | netFrameTime = stats.StatsBlock[9].StatValue; | 277 | netFrameTime = stats.StatsBlock[9].StatValue; |
272 | physicsFrameTime = stats.StatsBlock[10].StatValue; | 278 | physicsFrameTime = stats.StatsBlock[10].StatValue; |
273 | otherFrameTime = stats.StatsBlock[11].StatValue; | 279 | imageFrameTime = stats.StatsBlock[11].StatValue; |
274 | imageFrameTime = stats.StatsBlock[12].StatValue; | 280 | otherFrameTime = stats.StatsBlock[12].StatValue; |
275 | inPacketsPerSecond = stats.StatsBlock[13].StatValue; | 281 | inPacketsPerSecond = stats.StatsBlock[13].StatValue; |
276 | outPacketsPerSecond = stats.StatsBlock[14].StatValue; | 282 | outPacketsPerSecond = stats.StatsBlock[14].StatValue; |
277 | unackedBytes = stats.StatsBlock[15].StatValue; | 283 | unackedBytes = stats.StatsBlock[15].StatValue; |
@@ -279,12 +285,16 @@ namespace OpenSim.Framework.Monitoring | |||
279 | pendingDownloads = stats.StatsBlock[17].StatValue; | 285 | pendingDownloads = stats.StatsBlock[17].StatValue; |
280 | pendingUploads = stats.StatsBlock[18].StatValue; | 286 | pendingUploads = stats.StatsBlock[18].StatValue; |
281 | activeScripts = stats.StatsBlock[19].StatValue; | 287 | activeScripts = stats.StatsBlock[19].StatValue; |
282 | scriptLinesPerSecond = stats.StatsBlock[20].StatValue; | 288 | sleepTime = stats.StatsBlock[20].StatValue; |
283 | m_frameDilation = stats.StatsBlock[22].StatValue; | 289 | spareTime = stats.StatsBlock[21].StatValue; |
284 | m_usersLoggingIn = stats.StatsBlock[23].StatValue; | 290 | physicsStep = stats.StatsBlock[22].StatValue; |
285 | m_totalGeoPrims = stats.StatsBlock[24].StatValue; | 291 | |
286 | m_totalMeshes = stats.StatsBlock[25].StatValue; | 292 | scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue; |
287 | m_inUseThreads = stats.StatsBlock[26].StatValue; | 293 | m_frameDilation = stats.ExtraStatsBlock[1].StatValue; |
294 | m_usersLoggingIn = stats.ExtraStatsBlock[2].StatValue; | ||
295 | m_totalGeoPrims = stats.ExtraStatsBlock[3].StatValue; | ||
296 | m_totalMeshes = stats.ExtraStatsBlock[4].StatValue; | ||
297 | m_inUseThreads = stats.ExtraStatsBlock[5].StatValue; | ||
288 | } | 298 | } |
289 | 299 | ||
290 | /// <summary> | 300 | /// <summary> |
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index a7cb2a6..916fa53 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -239,6 +239,17 @@ namespace OpenSim.Framework.Monitoring | |||
239 | return sb.ToString(); | 239 | return sb.ToString(); |
240 | } | 240 | } |
241 | 241 | ||
242 | public virtual OSDMap ToBriefOSDMap() | ||
243 | { | ||
244 | OSDMap ret = new OSDMap(); | ||
245 | |||
246 | ret.Add("Value", OSD.FromReal(Value)); | ||
247 | |||
248 | double lastChangeOverTime, averageChangeOverTime; | ||
249 | |||
250 | return ret; | ||
251 | } | ||
252 | |||
242 | public virtual OSDMap ToOSDMap() | 253 | public virtual OSDMap ToOSDMap() |
243 | { | 254 | { |
244 | OSDMap ret = new OSDMap(); | 255 | OSDMap ret = new OSDMap(); |
@@ -323,4 +334,4 @@ namespace OpenSim.Framework.Monitoring | |||
323 | } | 334 | } |
324 | } | 335 | } |
325 | } | 336 | } |
326 | } \ No newline at end of file | 337 | } |
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 3136ee8..d0d1947 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs | |||
@@ -283,7 +283,7 @@ namespace OpenSim.Framework.Monitoring | |||
283 | if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName)) | 283 | if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName)) |
284 | continue; | 284 | continue; |
285 | 285 | ||
286 | statMap.Add(statName, theStats[statName].ToOSDMap()); | 286 | statMap.Add(statName, theStats[statName].ToBriefOSDMap()); |
287 | } | 287 | } |
288 | 288 | ||
289 | contMap.Add(contName, statMap); | 289 | contMap.Add(contName, statMap); |
@@ -554,4 +554,4 @@ namespace OpenSim.Framework.Monitoring | |||
554 | Debug, | 554 | Debug, |
555 | Info | 555 | Info |
556 | } | 556 | } |
557 | } \ No newline at end of file | 557 | } |
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index a644fa5..4485a9c 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -335,7 +335,9 @@ namespace OpenSim.Framework.Monitoring | |||
335 | 335 | ||
336 | lock (m_threads) | 336 | lock (m_threads) |
337 | { | 337 | { |
338 | foreach (ThreadWatchdogInfo threadInfo in m_threads.Values) | 338 | // get a copy since we may change m_threads |
339 | List<ThreadWatchdogInfo> threadsInfo = m_threads.Values.ToList(); | ||
340 | foreach (ThreadWatchdogInfo threadInfo in threadsInfo) | ||
339 | { | 341 | { |
340 | if (threadInfo.Thread.ThreadState == ThreadState.Stopped) | 342 | if (threadInfo.Thread.ThreadState == ThreadState.Stopped) |
341 | { | 343 | { |
@@ -377,4 +379,4 @@ namespace OpenSim.Framework.Monitoring | |||
377 | m_watchdogTimer.Start(); | 379 | m_watchdogTimer.Start(); |
378 | } | 380 | } |
379 | } | 381 | } |
380 | } \ No newline at end of file | 382 | } |