From ee8d726ec5cbcbaca8aebbcbfd25cfba963c43f8 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 23 Feb 2013 17:04:19 -0800 Subject: Modify StatsManager so console command "show stats category container" only outputs the statistics in the specified container in the category. --- OpenSim/Framework/Monitoring/StatsManager.cs | 29 +++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 910907e..24db6d4 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs @@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring if (cmd.Length > 2) { var categoryName = cmd[2]; + var containerName = cmd.Length > 3 ? cmd[3] : String.Empty; if (categoryName == AllSubCommand) { @@ -108,7 +109,20 @@ namespace OpenSim.Framework.Monitoring } else { - OutputCategoryStatsToConsole(con, category); + if (String.IsNullOrEmpty(containerName)) + OutputCategoryStatsToConsole(con, category); + else + { + SortedDictionary container; + if (category.TryGetValue(containerName, out container)) + { + OutputContainerStatsToConsole(con, container); + } + else + { + con.OutputFormat("No such container {0} in category {1}", containerName, categoryName); + } + } } } } @@ -124,10 +138,15 @@ namespace OpenSim.Framework.Monitoring { foreach (var container in category.Values) { - foreach (Stat stat in container.Values) - { - con.Output(stat.ToConsoleString()); - } + OutputContainerStatsToConsole(con, container); + } + } + + private static void OutputContainerStatsToConsole( ICommandConsole con, SortedDictionary container) + { + foreach (Stat stat in container.Values) + { + con.Output(stat.ToConsoleString()); } } -- cgit v1.1