aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Statistics/SimExtraStatsCollector.cs')
-rw-r--r--OpenSim/Framework/Statistics/SimExtraStatsCollector.cs248
1 files changed, 125 insertions, 123 deletions
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index 5449757..a506e3b 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -42,15 +42,15 @@ namespace OpenSim.Framework.Statistics
42 { 42 {
43 private long abnormalClientThreadTerminations; 43 private long abnormalClientThreadTerminations;
44 44
45 private long assetsInCache; 45// private long assetsInCache;
46 private long texturesInCache; 46// private long texturesInCache;
47 private long assetCacheMemoryUsage; 47// private long assetCacheMemoryUsage;
48 private long textureCacheMemoryUsage; 48// private long textureCacheMemoryUsage;
49 private TimeSpan assetRequestTimeAfterCacheMiss; 49// private TimeSpan assetRequestTimeAfterCacheMiss;
50 private long blockedMissingTextureRequests; 50// private long blockedMissingTextureRequests;
51 51
52 private long assetServiceRequestFailures; 52// private long assetServiceRequestFailures;
53 private long inventoryServiceRetrievalFailures; 53// private long inventoryServiceRetrievalFailures;
54 54
55 private volatile float timeDilation; 55 private volatile float timeDilation;
56 private volatile float simFps; 56 private volatile float simFps;
@@ -79,27 +79,27 @@ namespace OpenSim.Framework.Statistics
79 /// </summary> 79 /// </summary>
80 public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } } 80 public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } }
81 81
82 /// <summary> 82// /// <summary>
83 /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the 83// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
84 /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these 84// /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
85 /// haven't yet been implemented... 85// /// haven't yet been implemented...
86 /// </summary> 86// /// </summary>
87 public long AssetsInCache { get { return assetsInCache; } } 87// public long AssetsInCache { get { return assetsInCache; } }
88 88//
89 /// <value> 89// /// <value>
90 /// Currently unused 90// /// Currently unused
91 /// </value> 91// /// </value>
92 public long TexturesInCache { get { return texturesInCache; } } 92// public long TexturesInCache { get { return texturesInCache; } }
93 93//
94 /// <value> 94// /// <value>
95 /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit 95// /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit
96 /// </value> 96// /// </value>
97 public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } 97// public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
98 98//
99 /// <value> 99// /// <value>
100 /// Currently unused 100// /// Currently unused
101 /// </value> 101// /// </value>
102 public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } 102// public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
103 103
104 public float TimeDilation { get { return timeDilation; } } 104 public float TimeDilation { get { return timeDilation; } }
105 public float SimFps { get { return simFps; } } 105 public float SimFps { get { return simFps; } }
@@ -123,32 +123,33 @@ namespace OpenSim.Framework.Statistics
123 public float ActiveScripts { get { return activeScripts; } } 123 public float ActiveScripts { get { return activeScripts; } }
124 public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } } 124 public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } }
125 125
126 /// <summary> 126// /// <summary>
127 /// This is the time it took for the last asset request made in response to a cache miss. 127// /// This is the time it took for the last asset request made in response to a cache miss.
128 /// </summary> 128// /// </summary>
129 public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } } 129// public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } }
130 130//
131 /// <summary> 131// /// <summary>
132 /// Number of persistent requests for missing textures we have started blocking from clients. To some extent 132// /// Number of persistent requests for missing textures we have started blocking from clients. To some extent
133 /// this is just a temporary statistic to keep this problem in view - the root cause of this lies either 133// /// this is just a temporary statistic to keep this problem in view - the root cause of this lies either
134 /// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics 134// /// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics
135 /// driver bugs on clients (though this seems less likely). 135// /// driver bugs on clients (though this seems less likely).
136 /// </summary> 136// /// </summary>
137 public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } } 137// public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
138 138//
139 /// <summary> 139// /// <summary>
140 /// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as 140// /// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as
141 /// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted 141// /// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted
142 /// as a failure 142// /// as a failure
143 /// </summary> 143// /// </summary>
144 public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } 144// public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } }
145 145
146 /// <summary> 146 /// <summary>
147 /// Number of known failures to retrieve avatar inventory from the inventory service. This does not 147 /// Number of known failures to retrieve avatar inventory from the inventory service. This does not
148 /// cover situations where the inventory service accepts the request but never returns any data, since 148 /// cover situations where the inventory service accepts the request but never returns any data, since
149 /// we do not yet timeout this situation. 149 /// we do not yet timeout this situation.
150 /// </summary> 150 /// </summary>
151 public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } 151 /// <remarks>Commented out because we do not cache inventory at this point</remarks>
152// public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
152 153
153 /// <summary> 154 /// <summary>
154 /// Retrieve the total frame time (in ms) of the last frame 155 /// Retrieve the total frame time (in ms) of the last frame
@@ -171,58 +172,58 @@ namespace OpenSim.Framework.Statistics
171 abnormalClientThreadTerminations++; 172 abnormalClientThreadTerminations++;
172 } 173 }
173 174
174 public void AddAsset(AssetBase asset) 175// public void AddAsset(AssetBase asset)
175 { 176// {
176 assetsInCache++; 177// assetsInCache++;
177 //assetCacheMemoryUsage += asset.Data.Length; 178// //assetCacheMemoryUsage += asset.Data.Length;
178 } 179// }
179 180//
180 public void RemoveAsset(UUID uuid) 181// public void RemoveAsset(UUID uuid)
181 { 182// {
182 assetsInCache--; 183// assetsInCache--;
183 } 184// }
184 185//
185 public void AddTexture(AssetBase image) 186// public void AddTexture(AssetBase image)
186 { 187// {
187 if (image.Data != null) 188// if (image.Data != null)
188 { 189// {
189 texturesInCache++; 190// texturesInCache++;
190 191//
191 // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates 192// // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
192 textureCacheMemoryUsage += image.Data.Length; 193// textureCacheMemoryUsage += image.Data.Length;
193 } 194// }
194 } 195// }
195 196//
196 /// <summary> 197// /// <summary>
197 /// Signal that the asset cache has been cleared. 198// /// Signal that the asset cache has been cleared.
198 /// </summary> 199// /// </summary>
199 public void ClearAssetCacheStatistics() 200// public void ClearAssetCacheStatistics()
200 { 201// {
201 assetsInCache = 0; 202// assetsInCache = 0;
202 assetCacheMemoryUsage = 0; 203// assetCacheMemoryUsage = 0;
203 texturesInCache = 0; 204// texturesInCache = 0;
204 textureCacheMemoryUsage = 0; 205// textureCacheMemoryUsage = 0;
205 } 206// }
206 207//
207 public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts) 208// public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts)
208 { 209// {
209 assetRequestTimeAfterCacheMiss = ts; 210// assetRequestTimeAfterCacheMiss = ts;
210 } 211// }
211 212//
212 public void AddBlockedMissingTextureRequest() 213// public void AddBlockedMissingTextureRequest()
213 { 214// {
214 blockedMissingTextureRequests++; 215// blockedMissingTextureRequests++;
215 } 216// }
216 217//
217 public void AddAssetServiceRequestFailure() 218// public void AddAssetServiceRequestFailure()
218 { 219// {
219 assetServiceRequestFailures++; 220// assetServiceRequestFailures++;
220 } 221// }
221 222
222 public void AddInventoryServiceRetrievalFailure() 223// public void AddInventoryServiceRetrievalFailure()
223 { 224// {
224 inventoryServiceRetrievalFailures++; 225// inventoryServiceRetrievalFailures++;
225 } 226// }
226 227
227 /// <summary> 228 /// <summary>
228 /// Register as a packet queue stats provider 229 /// Register as a packet queue stats provider
@@ -290,8 +291,8 @@ namespace OpenSim.Framework.Statistics
290 public override string Report() 291 public override string Report()
291 { 292 {
292 StringBuilder sb = new StringBuilder(Environment.NewLine); 293 StringBuilder sb = new StringBuilder(Environment.NewLine);
293 sb.Append("ASSET STATISTICS"); 294// sb.Append("ASSET STATISTICS");
294 sb.Append(Environment.NewLine); 295// sb.Append(Environment.NewLine);
295 296
296 /* 297 /*
297 sb.Append( 298 sb.Append(
@@ -307,7 +308,8 @@ Asset service request failures: {6}"+ Environment.NewLine,
307 BlockedMissingTextureRequests, 308 BlockedMissingTextureRequests,
308 AssetServiceRequestFailures)); 309 AssetServiceRequestFailures));
309 */ 310 */
310 311
312 /*
311 sb.Append( 313 sb.Append(
312 string.Format( 314 string.Format(
313@"Asset cache contains {0,6} assets 315@"Asset cache contains {0,6} assets
@@ -318,7 +320,7 @@ Asset service request failures: {3}" + Environment.NewLine,
318 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0, 320 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0,
319 BlockedMissingTextureRequests, 321 BlockedMissingTextureRequests,
320 AssetServiceRequestFailures)); 322 AssetServiceRequestFailures));
321 323 */
322 324
323 sb.Append(Environment.NewLine); 325 sb.Append(Environment.NewLine);
324 sb.Append("CONNECTION STATISTICS"); 326 sb.Append("CONNECTION STATISTICS");
@@ -328,13 +330,13 @@ Asset service request failures: {3}" + Environment.NewLine,
328 "Abnormal client thread terminations: {0}" + Environment.NewLine, 330 "Abnormal client thread terminations: {0}" + Environment.NewLine,
329 abnormalClientThreadTerminations)); 331 abnormalClientThreadTerminations));
330 332
331 sb.Append(Environment.NewLine); 333// sb.Append(Environment.NewLine);
332 sb.Append("INVENTORY STATISTICS"); 334// sb.Append("INVENTORY STATISTICS");
333 sb.Append(Environment.NewLine); 335// sb.Append(Environment.NewLine);
334 sb.Append( 336// sb.Append(
335 string.Format( 337// string.Format(
336 "Initial inventory caching failures: {0}" + Environment.NewLine, 338// "Initial inventory caching failures: {0}" + Environment.NewLine,
337 InventoryServiceRetrievalFailures)); 339// InventoryServiceRetrievalFailures));
338 340
339 sb.Append(Environment.NewLine); 341 sb.Append(Environment.NewLine);
340 sb.Append("FRAME STATISTICS"); 342 sb.Append("FRAME STATISTICS");
@@ -390,17 +392,17 @@ Asset service request failures: {3}" + Environment.NewLine,
390 public override string XReport(string uptime, string version) 392 public override string XReport(string uptime, string version)
391 { 393 {
392 OSDMap args = new OSDMap(30); 394 OSDMap args = new OSDMap(30);
393 args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache)); 395// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
394 args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}", 396// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
395 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0)); 397// assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
396 args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}", 398// args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
397 BlockedMissingTextureRequests)); 399// BlockedMissingTextureRequests));
398 args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}", 400// args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
399 AssetServiceRequestFailures)); 401// AssetServiceRequestFailures));
400 args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}", 402// args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
401 abnormalClientThreadTerminations)); 403// abnormalClientThreadTerminations));
402 args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}", 404// args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
403 InventoryServiceRetrievalFailures)); 405// InventoryServiceRetrievalFailures));
404 args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation)); 406 args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation));
405 args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps)); 407 args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps));
406 args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps)); 408 args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps));