aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
diff options
context:
space:
mode:
authorJeff Ames2008-05-16 01:22:11 +0000
committerJeff Ames2008-05-16 01:22:11 +0000
commit65c5efe43b68700bad94076d4cd421160203c5de (patch)
tree589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
parentThank you very much, mjm for : (diff)
downloadopensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.zip
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2
opensim-SC_OLD-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Framework/Statistics/SimExtraStatsCollector.cs')
-rw-r--r--OpenSim/Framework/Statistics/SimExtraStatsCollector.cs62
1 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index fd021bc..2e7278b 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -32,20 +32,20 @@ using libsecondlife;
32using OpenSim.Framework.Statistics.Interfaces; 32using OpenSim.Framework.Statistics.Interfaces;
33 33
34namespace OpenSim.Framework.Statistics 34namespace OpenSim.Framework.Statistics
35{ 35{
36 /// <summary> 36 /// <summary>
37 /// Collects sim statistics which aren't already being collected for the linden viewer's statistics pane 37 /// Collects sim statistics which aren't already being collected for the linden viewer's statistics pane
38 /// </summary> 38 /// </summary>
39 public class SimExtraStatsCollector : IStatsCollector 39 public class SimExtraStatsCollector : IStatsCollector
40 { 40 {
41 private long assetsInCache; 41 private long assetsInCache;
42 private long texturesInCache; 42 private long texturesInCache;
43 private long assetCacheMemoryUsage; 43 private long assetCacheMemoryUsage;
44 private long textureCacheMemoryUsage; 44 private long textureCacheMemoryUsage;
45 private long blockedMissingTextureRequests; 45 private long blockedMissingTextureRequests;
46 46
47 private long inventoryServiceRetrievalFailures; 47 private long inventoryServiceRetrievalFailures;
48 48
49 public long AssetsInCache { get { return assetsInCache; } } 49 public long AssetsInCache { get { return assetsInCache; } }
50 public long TexturesInCache { get { return texturesInCache; } } 50 public long TexturesInCache { get { return texturesInCache; } }
51 public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } 51 public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
@@ -58,47 +58,47 @@ namespace OpenSim.Framework.Statistics
58 /// driver bugs on clients (though this seems less likely). 58 /// driver bugs on clients (though this seems less likely).
59 /// </summary> 59 /// </summary>
60 public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } } 60 public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
61 61
62 /// <summary> 62 /// <summary>
63 /// Number of known failures to retrieve avatar inventory from the inventory service. This does not 63 /// Number of known failures to retrieve avatar inventory from the inventory service. This does not
64 /// cover situations where the inventory service accepts the request but never returns any data, since 64 /// cover situations where the inventory service accepts the request but never returns any data, since
65 /// we do not yet timeout this situation. 65 /// we do not yet timeout this situation.
66 /// </summary> 66 /// </summary>
67 public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } 67 public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
68 68
69 /// <summary> 69 /// <summary>
70 /// Retain a dictionary of all packet queues stats reporters 70 /// Retain a dictionary of all packet queues stats reporters
71 /// </summary> 71 /// </summary>
72 private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors 72 private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors
73 = new Dictionary<LLUUID, PacketQueueStatsCollector>(); 73 = new Dictionary<LLUUID, PacketQueueStatsCollector>();
74 74
75 public void AddAsset(AssetBase asset) 75 public void AddAsset(AssetBase asset)
76 { 76 {
77 assetsInCache++; 77 assetsInCache++;
78 assetCacheMemoryUsage += asset.Data.Length; 78 assetCacheMemoryUsage += asset.Data.Length;
79 } 79 }
80 80
81 public void AddTexture(AssetBase image) 81 public void AddTexture(AssetBase image)
82 { 82 {
83 if (image.Data != null) 83 if (image.Data != null)
84 { 84 {
85 texturesInCache++; 85 texturesInCache++;
86 86
87 // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates 87 // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
88 textureCacheMemoryUsage += image.Data.Length; 88 textureCacheMemoryUsage += image.Data.Length;
89 } 89 }
90 } 90 }
91 91
92 public void AddBlockedMissingTextureRequest() 92 public void AddBlockedMissingTextureRequest()
93 { 93 {
94 blockedMissingTextureRequests++; 94 blockedMissingTextureRequests++;
95 } 95 }
96 96
97 public void AddInventoryServiceRetrievalFailure() 97 public void AddInventoryServiceRetrievalFailure()
98 { 98 {
99 inventoryServiceRetrievalFailures++; 99 inventoryServiceRetrievalFailures++;
100 } 100 }
101 101
102 /// <summary> 102 /// <summary>
103 /// Register as a packet queue stats provider 103 /// Register as a packet queue stats provider
104 /// </summary> 104 /// </summary>
@@ -111,7 +111,7 @@ namespace OpenSim.Framework.Statistics
111 packetQueueStatsCollectors[uuid] = new PacketQueueStatsCollector(provider); 111 packetQueueStatsCollectors[uuid] = new PacketQueueStatsCollector(provider);
112 } 112 }
113 } 113 }
114 114
115 /// <summary> 115 /// <summary>
116 /// Deregister a packet queue stats provider 116 /// Deregister a packet queue stats provider
117 /// </summary> 117 /// </summary>
@@ -129,25 +129,25 @@ namespace OpenSim.Framework.Statistics
129 /// </summary> 129 /// </summary>
130 /// <returns></returns> 130 /// <returns></returns>
131 public string Report() 131 public string Report()
132 { 132 {
133 StringBuilder sb = new StringBuilder(Environment.NewLine); 133 StringBuilder sb = new StringBuilder(Environment.NewLine);
134 sb.Append("ASSET STATISTICS"); 134 sb.Append("ASSET STATISTICS");
135 sb.Append(Environment.NewLine); 135 sb.Append(Environment.NewLine);
136 sb.Append( 136 sb.Append(
137 string.Format( 137 string.Format(
138@"Asset cache contains {0,6} assets using {1,10:0.000}K" + Environment.NewLine, 138@"Asset cache contains {0,6} assets using {1,10:0.000}K" + Environment.NewLine,
139 AssetsInCache, AssetCacheMemoryUsage / 1024.0)); 139 AssetsInCache, AssetCacheMemoryUsage / 1024.0));
140 140
141 sb.Append(Environment.NewLine); 141 sb.Append(Environment.NewLine);
142 sb.Append("TEXTURE STATISTICS"); 142 sb.Append("TEXTURE STATISTICS");
143 sb.Append(Environment.NewLine); 143 sb.Append(Environment.NewLine);
144 sb.Append( 144 sb.Append(
145 string.Format( 145 string.Format(
146@"Texture cache contains {0,6} textures using {1,10:0.000}K 146@"Texture cache contains {0,6} textures using {1,10:0.000}K
147Blocked requests for missing textures: {2}" + Environment.NewLine, 147Blocked requests for missing textures: {2}" + Environment.NewLine,
148 TexturesInCache, TextureCacheMemoryUsage / 1024.0, 148 TexturesInCache, TextureCacheMemoryUsage / 1024.0,
149 BlockedMissingTextureRequests)); 149 BlockedMissingTextureRequests));
150 150
151 sb.Append(Environment.NewLine); 151 sb.Append(Environment.NewLine);
152 sb.Append("INVENTORY STATISTICS"); 152 sb.Append("INVENTORY STATISTICS");
153 sb.Append(Environment.NewLine); 153 sb.Append(Environment.NewLine);
@@ -155,26 +155,26 @@ Blocked requests for missing textures: {2}" + Environment.NewLine,
155 string.Format( 155 string.Format(
156 "Initial inventory caching failures: {0}" + Environment.NewLine, 156 "Initial inventory caching failures: {0}" + Environment.NewLine,
157 InventoryServiceRetrievalFailures)); 157 InventoryServiceRetrievalFailures));
158 158
159 sb.Append(Environment.NewLine); 159 sb.Append(Environment.NewLine);
160 sb.Append("PACKET QUEUE STATISTICS"); 160 sb.Append("PACKET QUEUE STATISTICS");
161 sb.Append(Environment.NewLine); 161 sb.Append(Environment.NewLine);
162 sb.Append("Agent UUID "); 162 sb.Append("Agent UUID ");
163 sb.Append( 163 sb.Append(
164 string.Format( 164 string.Format(
165 " {0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", 165 " {0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
166 "Send", "In", "Out", "Resend", "Land", "Wind", "Cloud", "Task", "Texture", "Asset")); 166 "Send", "In", "Out", "Resend", "Land", "Wind", "Cloud", "Task", "Texture", "Asset"));
167 sb.Append(Environment.NewLine); 167 sb.Append(Environment.NewLine);
168 168
169 foreach (LLUUID key in packetQueueStatsCollectors.Keys) 169 foreach (LLUUID key in packetQueueStatsCollectors.Keys)
170 { 170 {
171 sb.Append(string.Format("{0}: ", key)); 171 sb.Append(string.Format("{0}: ", key));
172 sb.Append(packetQueueStatsCollectors[key].Report()); 172 sb.Append(packetQueueStatsCollectors[key].Report());
173 sb.Append(Environment.NewLine); 173 sb.Append(Environment.NewLine);
174 } 174 }
175 175
176 return sb.ToString(); 176 return sb.ToString();
177 } 177 }
178 } 178 }
179 179
180 /// <summary> 180 /// <summary>
@@ -183,16 +183,16 @@ Blocked requests for missing textures: {2}" + Environment.NewLine,
183 public class PacketQueueStatsCollector : IStatsCollector 183 public class PacketQueueStatsCollector : IStatsCollector
184 { 184 {
185 private IPullStatsProvider m_statsProvider; 185 private IPullStatsProvider m_statsProvider;
186 186
187 public PacketQueueStatsCollector(IPullStatsProvider provider) 187 public PacketQueueStatsCollector(IPullStatsProvider provider)
188 { 188 {
189 m_statsProvider = provider; 189 m_statsProvider = provider;
190 } 190 }
191 191
192 /// <summary> 192 /// <summary>
193 /// Report back collected statistical information. 193 /// Report back collected statistical information.
194 /// </summary> 194 /// </summary>
195 /// <returns></returns> 195 /// <returns></returns>
196 public string Report() 196 public string Report()
197 { 197 {
198 return m_statsProvider.GetStats(); 198 return m_statsProvider.GetStats();