diff options
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-rw-r--r-- | OpenSim/Framework/Monitoring/BaseStatsCollector.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Checks/Check.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/JobEngine.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/ServerStatsCollector.cs | 26 | ||||
-rwxr-xr-x | OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | 28 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Stats/Stat.cs | 38 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsLogger.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/WorkManager.cs | 32 |
12 files changed, 83 insertions, 83 deletions
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs index 8c2bec6..e513abd 100644 --- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs | |||
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Monitoring | |||
78 | 78 | ||
79 | return sb.ToString(); | 79 | return sb.ToString(); |
80 | } | 80 | } |
81 | 81 | ||
82 | public virtual string XReport(string uptime, string version) | 82 | public virtual string XReport(string uptime, string version) |
83 | { | 83 | { |
84 | return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; | 84 | return (string) Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0).ToString() ; |
diff --git a/OpenSim/Framework/Monitoring/Checks/Check.cs b/OpenSim/Framework/Monitoring/Checks/Check.cs index 594386a..9a1bd45 100644 --- a/OpenSim/Framework/Monitoring/Checks/Check.cs +++ b/OpenSim/Framework/Monitoring/Checks/Check.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Monitoring | |||
79 | string category, | 79 | string category, |
80 | string container, | 80 | string container, |
81 | Func<Check, bool> checkFunc, | 81 | Func<Check, bool> checkFunc, |
82 | StatVerbosity verbosity) | 82 | StatVerbosity verbosity) |
83 | { | 83 | { |
84 | if (ChecksManager.SubCommands.Contains(category)) | 84 | if (ChecksManager.SubCommands.Contains(category)) |
85 | throw new Exception( | 85 | throw new Exception( |
@@ -108,9 +108,9 @@ namespace OpenSim.Framework.Monitoring | |||
108 | public virtual string ToConsoleString() | 108 | public virtual string ToConsoleString() |
109 | { | 109 | { |
110 | return string.Format( | 110 | return string.Format( |
111 | "{0}.{1}.{2} - {3}", | 111 | "{0}.{1}.{2} - {3}", |
112 | Category, | 112 | Category, |
113 | Container, | 113 | Container, |
114 | ShortName, | 114 | ShortName, |
115 | Description); | 115 | Description); |
116 | } | 116 | } |
diff --git a/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs b/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs index 40df562..e326e8b 100644 --- a/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/Interfaces/IStatsCollector.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Framework.Monitoring | |||
39 | /// </summary> | 39 | /// </summary> |
40 | /// <returns></returns> | 40 | /// <returns></returns> |
41 | string Report(); | 41 | string Report(); |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Report back collected statistical information in json | 44 | /// Report back collected statistical information in json |
45 | /// </summary> | 45 | /// </summary> |
diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs index df6b806..0a39e4b 100644 --- a/OpenSim/Framework/Monitoring/JobEngine.cs +++ b/OpenSim/Framework/Monitoring/JobEngine.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Framework.Monitoring | |||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Is this engine running? | 50 | /// Is this engine running? |
51 | /// </summary> | 51 | /// </summary> |
52 | public bool IsRunning { get; private set; } | 52 | public bool IsRunning { get; private set; } |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// The current job that the engine is running. | 55 | /// The current job that the engine is running. |
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.Monitoring | |||
73 | /// Controls whether we need to warn in the log about exceeding the max queue size. | 73 | /// Controls whether we need to warn in the log about exceeding the max queue size. |
74 | /// </summary> | 74 | /// </summary> |
75 | /// <remarks> | 75 | /// <remarks> |
76 | /// This is flipped to false once queue max has been exceeded and back to true when it falls below max, in | 76 | /// This is flipped to false once queue max has been exceeded and back to true when it falls below max, in |
77 | /// order to avoid spamming the log with lots of warnings. | 77 | /// order to avoid spamming the log with lots of warnings. |
78 | /// </remarks> | 78 | /// </remarks> |
79 | private bool m_warnOverMaxQueue = true; | 79 | private bool m_warnOverMaxQueue = true; |
@@ -120,7 +120,7 @@ namespace OpenSim.Framework.Monitoring | |||
120 | } | 120 | } |
121 | 121 | ||
122 | public void Stop() | 122 | public void Stop() |
123 | { | 123 | { |
124 | lock (JobLock) | 124 | lock (JobLock) |
125 | { | 125 | { |
126 | try | 126 | try |
@@ -150,7 +150,7 @@ namespace OpenSim.Framework.Monitoring | |||
150 | /// Make a job. | 150 | /// Make a job. |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <remarks> | 152 | /// <remarks> |
153 | /// We provide this method to replace the constructor so that we can later pool job objects if necessary to | 153 | /// We provide this method to replace the constructor so that we can later pool job objects if necessary to |
154 | /// reduce memory churn. Normally one would directly call QueueJob() with parameters anyway. | 154 | /// reduce memory churn. Normally one would directly call QueueJob() with parameters anyway. |
155 | /// </remarks> | 155 | /// </remarks> |
156 | /// <returns></returns> | 156 | /// <returns></returns> |
@@ -304,7 +304,7 @@ namespace OpenSim.Framework.Monitoring | |||
304 | CommonId = commonId; | 304 | CommonId = commonId; |
305 | Action = action; | 305 | Action = action; |
306 | } | 306 | } |
307 | 307 | ||
308 | /// <summary> | 308 | /// <summary> |
309 | /// Make a job. It needs to be separately queued. | 309 | /// Make a job. It needs to be separately queued. |
310 | /// </summary> | 310 | /// </summary> |
diff --git a/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs b/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs index 756e4ed..2ff2014 100644 --- a/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs | |||
@@ -2,7 +2,7 @@ | |||
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // General Information about an assembly is controlled through the following | 5 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 6 | // set of attributes. Change these attribute values to modify the information |
7 | // associated with an assembly. | 7 | // associated with an assembly. |
8 | [assembly: AssemblyTitle("OpenSim.Framework.Monitoring")] | 8 | [assembly: AssemblyTitle("OpenSim.Framework.Monitoring")] |
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices; | |||
14 | [assembly: AssemblyTrademark("")] | 14 | [assembly: AssemblyTrademark("")] |
15 | [assembly: AssemblyCulture("")] | 15 | [assembly: AssemblyCulture("")] |
16 | 16 | ||
17 | // Setting ComVisible to false makes the types in this assembly not visible | 17 | // Setting ComVisible to false makes the types in this assembly not visible |
18 | // to COM components. If you need to access a type in this assembly from | 18 | // to COM components. If you need to access a type in this assembly from |
19 | // COM, set the ComVisible attribute to true on that type. | 19 | // COM, set the ComVisible attribute to true on that type. |
20 | [assembly: ComVisible(false)] | 20 | [assembly: ComVisible(false)] |
21 | 21 | ||
@@ -25,7 +25,7 @@ using System.Runtime.InteropServices; | |||
25 | // Version information for an assembly consists of the following four values: | 25 | // Version information for an assembly consists of the following four values: |
26 | // | 26 | // |
27 | // Major Version | 27 | // Major Version |
28 | // Minor Version | 28 | // Minor Version |
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
diff --git a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs index be4a8b4..3391240 100644 --- a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs | |||
@@ -167,18 +167,18 @@ namespace OpenSim.Framework.Monitoring | |||
167 | } | 167 | } |
168 | 168 | ||
169 | MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool, | 169 | MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool, |
170 | s => | 170 | s => |
171 | { | 171 | { |
172 | int workerThreads, iocpThreads; | 172 | int workerThreads, iocpThreads; |
173 | ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); | 173 | ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); |
174 | s.Value = workerThreads; | 174 | s.Value = workerThreads; |
175 | }); | 175 | }); |
176 | 176 | ||
177 | MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool, | 177 | MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool, |
178 | s => | 178 | s => |
179 | { | 179 | { |
180 | int workerThreads, iocpThreads; | 180 | int workerThreads, iocpThreads; |
181 | ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); | 181 | ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); |
182 | s.Value = iocpThreads; | 182 | s.Value = iocpThreads; |
183 | }); | 183 | }); |
184 | 184 | ||
@@ -193,10 +193,10 @@ namespace OpenSim.Framework.Monitoring | |||
193 | } | 193 | } |
194 | 194 | ||
195 | MakeStat( | 195 | MakeStat( |
196 | "HTTPRequestsMade", | 196 | "HTTPRequestsMade", |
197 | "Number of outbound HTTP requests made", | 197 | "Number of outbound HTTP requests made", |
198 | "requests", | 198 | "requests", |
199 | ContainerNetwork, | 199 | ContainerNetwork, |
200 | s => s.Value = WebUtil.RequestNumber, | 200 | s => s.Value = WebUtil.RequestNumber, |
201 | MeasuresOfInterest.AverageChangeOverTime); | 201 | MeasuresOfInterest.AverageChangeOverTime); |
202 | 202 | ||
@@ -294,7 +294,7 @@ namespace OpenSim.Framework.Monitoring | |||
294 | }); | 294 | }); |
295 | } | 295 | } |
296 | 296 | ||
297 | // Notes on performance counters: | 297 | // Notes on performance counters: |
298 | // "How To Read Performance Counters": http://blogs.msdn.com/b/bclteam/archive/2006/06/02/618156.aspx | 298 | // "How To Read Performance Counters": http://blogs.msdn.com/b/bclteam/archive/2006/06/02/618156.aspx |
299 | // "How to get the CPU Usage in C#": http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-in-c | 299 | // "How to get the CPU Usage in C#": http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-in-c |
300 | // "Mono Performance Counters": http://www.mono-project.com/Mono_Performance_Counters | 300 | // "Mono Performance Counters": http://www.mono-project.com/Mono_Performance_Counters |
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index 08c2409..88a0297 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs | |||
@@ -90,17 +90,17 @@ namespace OpenSim.Framework.Monitoring | |||
90 | // /// haven't yet been implemented... | 90 | // /// haven't yet been implemented... |
91 | // /// </summary> | 91 | // /// </summary> |
92 | // public long AssetsInCache { get { return assetsInCache; } } | 92 | // public long AssetsInCache { get { return assetsInCache; } } |
93 | // | 93 | // |
94 | // /// <value> | 94 | // /// <value> |
95 | // /// Currently unused | 95 | // /// Currently unused |
96 | // /// </value> | 96 | // /// </value> |
97 | // public long TexturesInCache { get { return texturesInCache; } } | 97 | // public long TexturesInCache { get { return texturesInCache; } } |
98 | // | 98 | // |
99 | // /// <value> | 99 | // /// <value> |
100 | // /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit | 100 | // /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit |
101 | // /// </value> | 101 | // /// </value> |
102 | // public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } | 102 | // public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } |
103 | // | 103 | // |
104 | // /// <value> | 104 | // /// <value> |
105 | // /// Currently unused | 105 | // /// Currently unused |
106 | // /// </value> | 106 | // /// </value> |
@@ -127,7 +127,7 @@ namespace OpenSim.Framework.Monitoring | |||
127 | public float PendingUploads { get { return pendingUploads; } } | 127 | public float PendingUploads { get { return pendingUploads; } } |
128 | public float ActiveScripts { get { return activeScripts; } } | 128 | public float ActiveScripts { get { return activeScripts; } } |
129 | public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } } | 129 | public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } } |
130 | 130 | ||
131 | // /// <summary> | 131 | // /// <summary> |
132 | // /// This is the time it took for the last asset request made in response to a cache miss. | 132 | // /// This is the time it took for the last asset request made in response to a cache miss. |
133 | // /// </summary> | 133 | // /// </summary> |
@@ -177,7 +177,7 @@ namespace OpenSim.Framework.Monitoring | |||
177 | // assetsInCache++; | 177 | // assetsInCache++; |
178 | // //assetCacheMemoryUsage += asset.Data.Length; | 178 | // //assetCacheMemoryUsage += asset.Data.Length; |
179 | // } | 179 | // } |
180 | // | 180 | // |
181 | // public void RemoveAsset(UUID uuid) | 181 | // public void RemoveAsset(UUID uuid) |
182 | // { | 182 | // { |
183 | // assetsInCache--; | 183 | // assetsInCache--; |
@@ -204,7 +204,7 @@ namespace OpenSim.Framework.Monitoring | |||
204 | // texturesInCache = 0; | 204 | // texturesInCache = 0; |
205 | // textureCacheMemoryUsage = 0; | 205 | // textureCacheMemoryUsage = 0; |
206 | // } | 206 | // } |
207 | // | 207 | // |
208 | // public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts) | 208 | // public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts) |
209 | // { | 209 | // { |
210 | // assetRequestTimeAfterCacheMiss = ts; | 210 | // assetRequestTimeAfterCacheMiss = ts; |
@@ -306,7 +306,7 @@ namespace OpenSim.Framework.Monitoring | |||
306 | StringBuilder sb = new StringBuilder(Environment.NewLine); | 306 | StringBuilder sb = new StringBuilder(Environment.NewLine); |
307 | // sb.Append("ASSET STATISTICS"); | 307 | // sb.Append("ASSET STATISTICS"); |
308 | // sb.Append(Environment.NewLine); | 308 | // sb.Append(Environment.NewLine); |
309 | 309 | ||
310 | /* | 310 | /* |
311 | sb.Append( | 311 | sb.Append( |
312 | string.Format( | 312 | string.Format( |
@@ -342,7 +342,7 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
342 | List<Stat> stats = StatsManager.GetStatsFromEachContainer("clientstack", "ClientLogoutsDueToNoReceives"); | 342 | List<Stat> stats = StatsManager.GetStatsFromEachContainer("clientstack", "ClientLogoutsDueToNoReceives"); |
343 | 343 | ||
344 | sb.AppendFormat( | 344 | sb.AppendFormat( |
345 | "Client logouts due to no data receive timeout: {0}\n\n", | 345 | "Client logouts due to no data receive timeout: {0}\n\n", |
346 | stats != null ? stats.Sum(s => s.Value).ToString() : "unknown"); | 346 | stats != null ? stats.Sum(s => s.Value).ToString() : "unknown"); |
347 | 347 | ||
348 | // sb.Append(Environment.NewLine); | 348 | // sb.Append(Environment.NewLine); |
@@ -443,10 +443,10 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
443 | foreach (ProcessThread currentThread in | 443 | foreach (ProcessThread currentThread in |
444 | Process.GetCurrentProcess().Threads) | 444 | Process.GetCurrentProcess().Threads) |
445 | { | 445 | { |
446 | // A known issue with the current process .Threads property is | 446 | // A known issue with the current process .Threads property is |
447 | // that it can return null threads, thus don't count those as | 447 | // that it can return null threads, thus don't count those as |
448 | // running threads and prevent the program function from failing | 448 | // running threads and prevent the program function from failing |
449 | if (currentThread != null && | 449 | if (currentThread != null && |
450 | currentThread.ThreadState == ThreadState.Running) | 450 | currentThread.ThreadState == ThreadState.Running) |
451 | { | 451 | { |
452 | numberThreadsRunning++; | 452 | numberThreadsRunning++; |
@@ -505,7 +505,7 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
505 | "{0:0.##}", numberThreadsRunning)); | 505 | "{0:0.##}", numberThreadsRunning)); |
506 | args["ProcMem"] = OSD.FromString(String.Format("{0:#,###,###.##}", | 506 | args["ProcMem"] = OSD.FromString(String.Format("{0:#,###,###.##}", |
507 | memUsage)); | 507 | memUsage)); |
508 | 508 | ||
509 | return args; | 509 | return args; |
510 | } | 510 | } |
511 | } | 511 | } |
@@ -531,12 +531,12 @@ Asset service request failures: {3}" + Environment.NewLine, | |||
531 | { | 531 | { |
532 | return m_statsProvider.GetStats(); | 532 | return m_statsProvider.GetStats(); |
533 | } | 533 | } |
534 | 534 | ||
535 | public string XReport(string uptime, string version) | 535 | public string XReport(string uptime, string version) |
536 | { | 536 | { |
537 | return ""; | 537 | return ""; |
538 | } | 538 | } |
539 | 539 | ||
540 | public OSDMap OReport(string uptime, string version) | 540 | public OSDMap OReport(string uptime, string version) |
541 | { | 541 | { |
542 | OSDMap ret = new OSDMap(); | 542 | OSDMap ret = new OSDMap(); |
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index 916fa53..2402acd 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs | |||
@@ -121,17 +121,17 @@ namespace OpenSim.Framework.Monitoring | |||
121 | string container, | 121 | string container, |
122 | StatType type, | 122 | StatType type, |
123 | Action<Stat> pullAction, | 123 | Action<Stat> pullAction, |
124 | StatVerbosity verbosity) | 124 | StatVerbosity verbosity) |
125 | : this( | 125 | : this( |
126 | shortName, | 126 | shortName, |
127 | name, | 127 | name, |
128 | description, | 128 | description, |
129 | unitName, | 129 | unitName, |
130 | category, | 130 | category, |
131 | container, | 131 | container, |
132 | type, | 132 | type, |
133 | MeasuresOfInterest.None, | 133 | MeasuresOfInterest.None, |
134 | pullAction, | 134 | pullAction, |
135 | verbosity) | 135 | verbosity) |
136 | { | 136 | { |
137 | } | 137 | } |
@@ -227,11 +227,11 @@ namespace OpenSim.Framework.Monitoring | |||
227 | { | 227 | { |
228 | StringBuilder sb = new StringBuilder(); | 228 | StringBuilder sb = new StringBuilder(); |
229 | sb.AppendFormat( | 229 | sb.AppendFormat( |
230 | "{0}.{1}.{2} : {3}{4}", | 230 | "{0}.{1}.{2} : {3}{4}", |
231 | Category, | 231 | Category, |
232 | Container, | 232 | Container, |
233 | ShortName, | 233 | ShortName, |
234 | Value, | 234 | Value, |
235 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); | 235 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); |
236 | 236 | ||
237 | AppendMeasuresOfInterest(sb); | 237 | AppendMeasuresOfInterest(sb); |
@@ -290,7 +290,7 @@ namespace OpenSim.Framework.Monitoring | |||
290 | lock (m_samples) | 290 | lock (m_samples) |
291 | { | 291 | { |
292 | // m_log.DebugFormat( | 292 | // m_log.DebugFormat( |
293 | // "[STAT]: Samples for {0} are {1}", | 293 | // "[STAT]: Samples for {0} are {1}", |
294 | // Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray())); | 294 | // Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray())); |
295 | 295 | ||
296 | foreach (double s in m_samples) | 296 | foreach (double s in m_samples) |
@@ -326,9 +326,9 @@ namespace OpenSim.Framework.Monitoring | |||
326 | if (ComputeMeasuresOfInterest(out lastChangeOverTime, out averageChangeOverTime)) | 326 | if (ComputeMeasuresOfInterest(out lastChangeOverTime, out averageChangeOverTime)) |
327 | { | 327 | { |
328 | sb.AppendFormat( | 328 | sb.AppendFormat( |
329 | ", {0:0.##}{1}/s, {2:0.##}{3}/s", | 329 | ", {0:0.##}{1}/s, {2:0.##}{3}/s", |
330 | lastChangeOverTime, | 330 | lastChangeOverTime, |
331 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), | 331 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName), |
332 | averageChangeOverTime, | 332 | averageChangeOverTime, |
333 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); | 333 | string.IsNullOrEmpty(UnitName) ? "" : string.Format(" {0}", UnitName)); |
334 | } | 334 | } |
diff --git a/OpenSim/Framework/Monitoring/StatsLogger.cs b/OpenSim/Framework/Monitoring/StatsLogger.cs index 15a37aa..b719af9 100644 --- a/OpenSim/Framework/Monitoring/StatsLogger.cs +++ b/OpenSim/Framework/Monitoring/StatsLogger.cs | |||
@@ -99,13 +99,13 @@ namespace OpenSim.Framework.Monitoring | |||
99 | } | 99 | } |
100 | 100 | ||
101 | string path = cmd[2]; | 101 | string path = cmd[2]; |
102 | 102 | ||
103 | using (StreamWriter sw = new StreamWriter(path, true)) | 103 | using (StreamWriter sw = new StreamWriter(path, true)) |
104 | { | 104 | { |
105 | foreach (string line in GetReport()) | 105 | foreach (string line in GetReport()) |
106 | sw.WriteLine(line); | 106 | sw.WriteLine(line); |
107 | } | 107 | } |
108 | 108 | ||
109 | MainConsole.Instance.OutputFormat("Stats saved to file {0}", path); | 109 | MainConsole.Instance.OutputFormat("Stats saved to file {0}", path); |
110 | } | 110 | } |
111 | 111 | ||
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 30926d8..55c3276 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs | |||
@@ -274,7 +274,7 @@ namespace OpenSim.Framework.Monitoring | |||
274 | { | 274 | { |
275 | if (!(string.IsNullOrEmpty(pContainerName) || pContainerName == AllSubCommand || pContainerName == contName)) | 275 | if (!(string.IsNullOrEmpty(pContainerName) || pContainerName == AllSubCommand || pContainerName == contName)) |
276 | continue; | 276 | continue; |
277 | 277 | ||
278 | OSDMap statMap = new OSDMap(); | 278 | OSDMap statMap = new OSDMap(); |
279 | 279 | ||
280 | SortedDictionary<string, Stat> theStats = RegisteredStats[catName][contName]; | 280 | SortedDictionary<string, Stat> theStats = RegisteredStats[catName][contName]; |
@@ -398,7 +398,7 @@ namespace OpenSim.Framework.Monitoring | |||
398 | { | 398 | { |
399 | if (!TryGetStatParents(stat, out category, out container)) | 399 | if (!TryGetStatParents(stat, out category, out container)) |
400 | return false; | 400 | return false; |
401 | 401 | ||
402 | if(container != null) | 402 | if(container != null) |
403 | { | 403 | { |
404 | container.Remove(stat.ShortName); | 404 | container.Remove(stat.ShortName); |
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index ff439f5..9cc61ee 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Monitoring | |||
96 | FirstTick = Environment.TickCount & Int32.MaxValue; | 96 | FirstTick = Environment.TickCount & Int32.MaxValue; |
97 | LastTick = FirstTick; | 97 | LastTick = FirstTick; |
98 | 98 | ||
99 | Stat | 99 | Stat |
100 | = new Stat( | 100 | = new Stat( |
101 | name, | 101 | name, |
102 | string.Format("Last update of thread {0}", name), | 102 | string.Format("Last update of thread {0}", name), |
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs index a7a03a0..43130f9 100644 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs | |||
@@ -36,16 +36,16 @@ namespace OpenSim.Framework.Monitoring | |||
36 | /// Manages various work items in the simulator. | 36 | /// Manages various work items in the simulator. |
37 | /// </summary> | 37 | /// </summary> |
38 | /// <remarks> | 38 | /// <remarks> |
39 | /// Currently, here work can be started | 39 | /// Currently, here work can be started |
40 | /// * As a long-running and monitored thread. | 40 | /// * As a long-running and monitored thread. |
41 | /// * In a thread that will never timeout but where the job is expected to eventually complete. | 41 | /// * In a thread that will never timeout but where the job is expected to eventually complete. |
42 | /// * In a threadpool thread that will timeout if it takes a very long time to complete (> 10 mins). | 42 | /// * In a threadpool thread that will timeout if it takes a very long time to complete (> 10 mins). |
43 | /// * As a job which will be run in a single-threaded job engine. Such jobs must not incorporate delays (sleeps, | 43 | /// * As a job which will be run in a single-threaded job engine. Such jobs must not incorporate delays (sleeps, |
44 | /// network waits, etc.). | 44 | /// network waits, etc.). |
45 | /// | 45 | /// |
46 | /// This is an evolving approach to better manage the work that OpenSimulator is asked to do from a very diverse | 46 | /// This is an evolving approach to better manage the work that OpenSimulator is asked to do from a very diverse |
47 | /// range of sources (client actions, incoming network, outgoing network calls, etc.). | 47 | /// range of sources (client actions, incoming network, outgoing network calls, etc.). |
48 | /// | 48 | /// |
49 | /// Util.FireAndForget is still available to insert jobs in the threadpool, though this is equivalent to | 49 | /// Util.FireAndForget is still available to insert jobs in the threadpool, though this is equivalent to |
50 | /// WorkManager.RunInThreadPool(). | 50 | /// WorkManager.RunInThreadPool(). |
51 | /// </remarks> | 51 | /// </remarks> |
@@ -122,7 +122,7 @@ namespace OpenSim.Framework.Monitoring | |||
122 | thread.Priority = priority; | 122 | thread.Priority = priority; |
123 | thread.IsBackground = isBackground; | 123 | thread.IsBackground = isBackground; |
124 | thread.Name = name; | 124 | thread.Name = name; |
125 | 125 | ||
126 | Watchdog.ThreadWatchdogInfo twi | 126 | Watchdog.ThreadWatchdogInfo twi |
127 | = new Watchdog.ThreadWatchdogInfo(thread, timeout, name) | 127 | = new Watchdog.ThreadWatchdogInfo(thread, timeout, name) |
128 | { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; | 128 | { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; |
@@ -144,7 +144,7 @@ namespace OpenSim.Framework.Monitoring | |||
144 | /// <param name="name">Name of the thread</param> | 144 | /// <param name="name">Name of the thread</param> |
145 | public static void RunInThread(WaitCallback callback, object obj, string name, bool log = false) | 145 | public static void RunInThread(WaitCallback callback, object obj, string name, bool log = false) |
146 | { | 146 | { |
147 | if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) | 147 | if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) |
148 | { | 148 | { |
149 | Culture.SetCurrentCulture(); | 149 | Culture.SetCurrentCulture(); |
150 | callback(obj); | 150 | callback(obj); |
@@ -169,7 +169,7 @@ namespace OpenSim.Framework.Monitoring | |||
169 | } | 169 | } |
170 | 170 | ||
171 | /// <summary> | 171 | /// <summary> |
172 | /// Run the callback via a threadpool thread. | 172 | /// Run the callback via a threadpool thread. |
173 | /// </summary> | 173 | /// </summary> |
174 | /// <remarks> | 174 | /// <remarks> |
175 | /// Such jobs may run after some delay but must always complete. | 175 | /// Such jobs may run after some delay but must always complete. |
@@ -188,17 +188,17 @@ namespace OpenSim.Framework.Monitoring | |||
188 | /// <remarks> | 188 | /// <remarks> |
189 | /// This differs from direct scheduling (e.g. Util.FireAndForget) in that a job can be run in the job | 189 | /// This differs from direct scheduling (e.g. Util.FireAndForget) in that a job can be run in the job |
190 | /// engine if it is running, where all jobs are currently performed in sequence on a single thread. This is | 190 | /// engine if it is running, where all jobs are currently performed in sequence on a single thread. This is |
191 | /// to prevent observed overload and server freeze problems when there are hundreds of connections which all attempt to | 191 | /// to prevent observed overload and server freeze problems when there are hundreds of connections which all attempt to |
192 | /// perform work at once (e.g. in conference situations). With lower numbers of connections, the small | 192 | /// perform work at once (e.g. in conference situations). With lower numbers of connections, the small |
193 | /// delay in performing jobs in sequence rather than concurrently has not been notiecable in testing, though a future more | 193 | /// delay in performing jobs in sequence rather than concurrently has not been notiecable in testing, though a future more |
194 | /// sophisticated implementation could perform jobs concurrently when the server is under low load. | 194 | /// sophisticated implementation could perform jobs concurrently when the server is under low load. |
195 | /// | 195 | /// |
196 | /// However, be advised that some callers of this function rely on all jobs being performed in sequence if any | 196 | /// However, be advised that some callers of this function rely on all jobs being performed in sequence if any |
197 | /// jobs are performed in sequence (i.e. if jobengine is active or not). Therefore, expanding the jobengine | 197 | /// jobs are performed in sequence (i.e. if jobengine is active or not). Therefore, expanding the jobengine |
198 | /// beyond a single thread will require considerable thought. | 198 | /// beyond a single thread will require considerable thought. |
199 | /// | 199 | /// |
200 | /// Also, any jobs submitted must be guaranteed to complete within a reasonable timeframe (e.g. they cannot | 200 | /// Also, any jobs submitted must be guaranteed to complete within a reasonable timeframe (e.g. they cannot |
201 | /// incorporate a network delay with a long timeout). At the moment, work that could suffer such issues | 201 | /// incorporate a network delay with a long timeout). At the moment, work that could suffer such issues |
202 | /// should still be run directly with RunInThread(), Util.FireAndForget(), etc. This is another area where | 202 | /// should still be run directly with RunInThread(), Util.FireAndForget(), etc. This is another area where |
203 | /// the job engine could be improved and so CPU utilization improved by better management of concurrency within | 203 | /// the job engine could be improved and so CPU utilization improved by better management of concurrency within |
204 | /// OpenSimulator. | 204 | /// OpenSimulator. |
@@ -212,10 +212,10 @@ namespace OpenSim.Framework.Monitoring | |||
212 | /// <param name="log">If set to true then extra logging is performed.</param> | 212 | /// <param name="log">If set to true then extra logging is performed.</param> |
213 | public static void RunJob( | 213 | public static void RunJob( |
214 | string jobType, WaitCallback callback, object obj, string name, | 214 | string jobType, WaitCallback callback, object obj, string name, |
215 | bool canRunInThisThread = false, bool mustNotTimeout = false, | 215 | bool canRunInThisThread = false, bool mustNotTimeout = false, |
216 | bool log = false) | 216 | bool log = false) |
217 | { | 217 | { |
218 | if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) | 218 | if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) |
219 | { | 219 | { |
220 | Culture.SetCurrentCulture(); | 220 | Culture.SetCurrentCulture(); |
221 | callback(obj); | 221 | callback(obj); |
@@ -273,16 +273,16 @@ namespace OpenSim.Framework.Monitoring | |||
273 | MainConsole.Instance.Output("Usage: debug jobengine log <level>"); | 273 | MainConsole.Instance.Output("Usage: debug jobengine log <level>"); |
274 | return; | 274 | return; |
275 | } | 275 | } |
276 | 276 | ||
277 | // int logLevel; | 277 | // int logLevel; |
278 | int logLevel = int.Parse(args[3]); | 278 | int logLevel = int.Parse(args[3]); |
279 | // if (ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out logLevel)) | 279 | // if (ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out logLevel)) |
280 | // { | 280 | // { |
281 | JobEngine.LogLevel = logLevel; | 281 | JobEngine.LogLevel = logLevel; |
282 | MainConsole.Instance.OutputFormat("Set debug log level to {0}", JobEngine.LogLevel); | 282 | MainConsole.Instance.OutputFormat("Set debug log level to {0}", JobEngine.LogLevel); |
283 | // } | 283 | // } |
284 | } | 284 | } |
285 | else | 285 | else |
286 | { | 286 | { |
287 | MainConsole.Instance.OutputFormat("Unrecognized job engine subcommand {0}", subCommand); | 287 | MainConsole.Instance.OutputFormat("Unrecognized job engine subcommand {0}", subCommand); |
288 | } | 288 | } |