mirror of
https://github.com/opensim/opensim.git
synced 2026-05-15 03:15:41 +08:00
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"
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user