aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring/StatsManager.cs
diff options
context:
space:
mode:
authorRobert Adams2015-12-27 15:05:17 -0800
committerRobert Adams2015-12-27 15:05:17 -0800
commit7831d219d7e42169d5cd86cf4fabaf3feca2e256 (patch)
treeba79904674ba4a74285f269fac873ca71f8a5d5b /OpenSim/Framework/Monitoring/StatsManager.cs
parentubMeshmerizer: remove some wrong faces still present in taper cases, some cod... (diff)
downloadopensim-SC-7831d219d7e42169d5cd86cf4fabaf3feca2e256.zip
opensim-SC-7831d219d7e42169d5cd86cf4fabaf3feca2e256.tar.gz
opensim-SC-7831d219d7e42169d5cd86cf4fabaf3feca2e256.tar.bz2
opensim-SC-7831d219d7e42169d5cd86cf4fabaf3feca2e256.tar.xz
Add locking around stats record fetch to resolve Mantis 7793.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs39
1 files changed, 21 insertions, 18 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index d0d1947..8787ea0 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -262,33 +262,36 @@ namespace OpenSim.Framework.Monitoring
262 { 262 {
263 OSDMap map = new OSDMap(); 263 OSDMap map = new OSDMap();
264 264
265 foreach (string catName in RegisteredStats.Keys) 265 lock (RegisteredStats)
266 { 266 {
267 // Do this category if null spec, "all" subcommand or category name matches passed parameter. 267 foreach (string catName in RegisteredStats.Keys)
268 // Skip category if none of the above.
269 if (!(String.IsNullOrEmpty(pCategoryName) || pCategoryName == AllSubCommand || pCategoryName == catName))
270 continue;
271
272 OSDMap contMap = new OSDMap();
273 foreach (string contName in RegisteredStats[catName].Keys)
274 { 268 {
275 if (!(string.IsNullOrEmpty(pContainerName) || pContainerName == AllSubCommand || pContainerName == contName)) 269 // Do this category if null spec, "all" subcommand or category name matches passed parameter.
270 // Skip category if none of the above.
271 if (!(String.IsNullOrEmpty(pCategoryName) || pCategoryName == AllSubCommand || pCategoryName == catName))
276 continue; 272 continue;
277
278 OSDMap statMap = new OSDMap();
279 273
280 SortedDictionary<string, Stat> theStats = RegisteredStats[catName][contName]; 274 OSDMap contMap = new OSDMap();
281 foreach (string statName in theStats.Keys) 275 foreach (string contName in RegisteredStats[catName].Keys)
282 { 276 {
283 if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName)) 277 if (!(string.IsNullOrEmpty(pContainerName) || pContainerName == AllSubCommand || pContainerName == contName))
284 continue; 278 continue;
279
280 OSDMap statMap = new OSDMap();
285 281
286 statMap.Add(statName, theStats[statName].ToBriefOSDMap()); 282 SortedDictionary<string, Stat> theStats = RegisteredStats[catName][contName];
287 } 283 foreach (string statName in theStats.Keys)
284 {
285 if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName))
286 continue;
288 287
289 contMap.Add(contName, statMap); 288 statMap.Add(statName, theStats[statName].ToBriefOSDMap());
289 }
290
291 contMap.Add(contName, statMap);
292 }
293 map.Add(catName, contMap);
290 } 294 }
291 map.Add(catName, contMap);
292 } 295 }
293 296
294 return map; 297 return map;