diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 05ee4c5628..8fcbdca2f3 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs @@ -99,6 +99,7 @@ namespace OpenSim.Framework.Monitoring string categoryName = components[0]; string containerName = components.Length > 1 ? components[1] : null; + string statName = components.Length > 2 ? components[2] : null; if (categoryName == AllSubCommand) { @@ -128,7 +129,23 @@ namespace OpenSim.Framework.Monitoring SortedDictionary container; if (category.TryGetValue(containerName, out container)) { - OutputContainerStatsToConsole(con, container); + if (String.IsNullOrEmpty(statName)) + { + OutputContainerStatsToConsole(con, container); + } + else + { + Stat stat; + if (container.TryGetValue(statName, out stat)) + { + OutputStatToConsole(con, stat); + } + else + { + con.OutputFormat( + "No such stat {0} in {1}.{2}", statName, categoryName, containerName); + } + } } else { @@ -200,6 +217,11 @@ namespace OpenSim.Framework.Monitoring con.Output(report); } + private static void OutputStatToConsole(ICommandConsole con, Stat stat) + { + con.Output(stat.ToConsoleString()); + } + // Creates an OSDMap of the format: // { categoryName: { // containerName: {