aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs36
1 files changed, 14 insertions, 22 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 008127e..c0be87b 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -80,16 +80,7 @@ namespace OpenSim.Framework.Monitoring
80 + "'all' will show all statistics.\n" 80 + "'all' will show all statistics.\n"
81 + "A <category> name will show statistics from that category.\n" 81 + "A <category> name will show statistics from that category.\n"
82 + "A <category>.<container> name will show statistics from that category in that container.\n" 82 + "A <category>.<container> name will show statistics from that category in that container.\n"
83 + "More than one name can be given separated by spaces.\n" 83 + "More than one name can be given separated by spaces.\n",
84 + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
85 HandleShowStatsCommand);
86
87 console.Commands.AddCommand(
88 "General",
89 false,
90 "show stats",
91 "show stats [list|all|(<category>[.<container>])+",
92 "Alias for 'stats show' command",
93 HandleShowStatsCommand); 84 HandleShowStatsCommand);
94 85
95 StatsLogger.RegisterConsoleCommands(console); 86 StatsLogger.RegisterConsoleCommands(console);
@@ -396,23 +387,24 @@ namespace OpenSim.Framework.Monitoring
396 /// <returns></returns> 387 /// <returns></returns>
397 public static bool DeregisterStat(Stat stat) 388 public static bool DeregisterStat(Stat stat)
398 { 389 {
399 SortedDictionary<string, SortedDictionary<string, Stat>> category = null, newCategory; 390 SortedDictionary<string, SortedDictionary<string, Stat>> category = null;
400 SortedDictionary<string, Stat> container = null, newContainer; 391 SortedDictionary<string, Stat> container = null;
401 392
402 lock (RegisteredStats) 393 lock (RegisteredStats)
403 { 394 {
404 if (!TryGetStatParents(stat, out category, out container)) 395 if (!TryGetStatParents(stat, out category, out container))
405 return false; 396 return false;
406 397
407 newContainer = new SortedDictionary<string, Stat>(container); 398 if(container != null)
408 newContainer.Remove(stat.ShortName); 399 {
409 400 container.Remove(stat.ShortName);
410 newCategory = new SortedDictionary<string, SortedDictionary<string, Stat>>(category); 401 if(category != null && container.Count == 0)
411 newCategory.Remove(stat.Container); 402 {
412 403 category.Remove(stat.Container);
413 newCategory[stat.Container] = newContainer; 404 if(category.Count == 0)
414 RegisteredStats[stat.Category] = newCategory; 405 RegisteredStats.Remove(stat.Category);
415 406 }
407 }
416 return true; 408 return true;
417 } 409 }
418 } 410 }