Modify StatsManager so console command "show stats category container"

only outputs the statistics in the specified container in the category.
0.7.4-extended
Robert Adams 2013-02-23 17:04:19 -08:00 committed by Justin Clark-Casey (justincc)
parent f3943a3677
commit caceca87e4
1 changed files with 24 additions and 5 deletions

View File

@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring
if (cmd.Length > 2) if (cmd.Length > 2)
{ {
var categoryName = cmd[2]; var categoryName = cmd[2];
var containerName = cmd.Length > 3 ? cmd[3] : String.Empty;
if (categoryName == AllSubCommand) if (categoryName == AllSubCommand)
{ {
@ -108,7 +109,20 @@ namespace OpenSim.Framework.Monitoring
} }
else else
{ {
if (String.IsNullOrEmpty(containerName))
OutputCategoryStatsToConsole(con, category); OutputCategoryStatsToConsole(con, category);
else
{
SortedDictionary<string, Stat> container;
if (category.TryGetValue(containerName, out container))
{
OutputContainerStatsToConsole(con, container);
}
else
{
con.OutputFormat("No such container {0} in category {1}", containerName, categoryName);
}
}
} }
} }
} }
@ -123,13 +137,18 @@ namespace OpenSim.Framework.Monitoring
ICommandConsole con, SortedDictionary<string, SortedDictionary<string, Stat>> category) ICommandConsole con, SortedDictionary<string, SortedDictionary<string, Stat>> category)
{ {
foreach (var container in category.Values) foreach (var container in category.Values)
{
OutputContainerStatsToConsole(con, container);
}
}
private static void OutputContainerStatsToConsole( ICommandConsole con, SortedDictionary<string, Stat> container)
{ {
foreach (Stat stat in container.Values) foreach (Stat stat in container.Values)
{ {
con.Output(stat.ToConsoleString()); con.Output(stat.ToConsoleString());
} }
} }
}
/// <summary> /// <summary>
/// Start collecting statistics related to assets. /// Start collecting statistics related to assets.