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
parent
e82d394ddf
commit
8ce3fa646b
|
@ -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)
|
||||
{
|
||||
|
@ -127,10 +128,26 @@ namespace OpenSim.Framework.Monitoring
|
|||
{
|
||||
SortedDictionary<string, Stat> container;
|
||||
if (category.TryGetValue(containerName, out 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
|
||||
{
|
||||
con.OutputFormat("No such container {0} in category {1}", containerName, categoryName);
|
||||
}
|
||||
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue