Allow "show stats" console command to take a full stat name and display only that stat.

For example, scene.test.RootAgents will show only the RootAgents stat in the scene named "test"
0.8.0.3
Justin Clark-Casey (justincc) 2014-03-18 20:21:47 +00:00
parent e82d394ddf
commit 8ce3fa646b
1 changed files with 23 additions and 1 deletions

View File

@ -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<string, Stat> 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: {