diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs
index 85d1a782ab..c57ee0c3e8 100644
--- a/OpenSim/Framework/Monitoring/Stats/Stat.cs
+++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Framework.Monitoring
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ public static readonly char[] DisallowedShortNameCharacters = { '.' };
+
///
/// Category of this stat (e.g. cache, scene, etc).
///
@@ -166,6 +168,12 @@ namespace OpenSim.Framework.Monitoring
throw new Exception(
string.Format("Stat cannot be in category '{0}' since this is reserved for a subcommand", category));
+ foreach (char c in DisallowedShortNameCharacters)
+ {
+ if (shortName.IndexOf(c) != -1)
+ throw new Exception(string.Format("Stat name {0} cannot contain character {1}", shortName, c));
+ }
+
ShortName = shortName;
Name = name;
Description = description;
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 3aee984cf8..af9f5ba182 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -68,12 +68,13 @@ namespace OpenSim.Framework.Monitoring
"General",
false,
"show stats",
- "show stats [list|all|]",
+ "show stats [list|all|[.]",
"Show statistical information for this server",
"If no final argument is specified then legacy statistics information is currently shown.\n"
+ "If list is specified then statistic categories are shown.\n"
+ "If all is specified then all registered statistics are shown.\n"
+ "If a category name is specified then only statistics from that category are shown.\n"
+ + "If a category container is also specified then only statistics from that category in that container are shown.\n"
+ "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
HandleShowStatsCommand);
}
@@ -84,8 +85,11 @@ namespace OpenSim.Framework.Monitoring
if (cmd.Length > 2)
{
- var categoryName = cmd[2];
- var containerName = cmd.Length > 3 ? cmd[3] : String.Empty;
+ string name = cmd[2];
+ string[] components = name.Split('.');
+
+ string categoryName = components[0];
+ string containerName = components.Length > 1 ? components[1] : null;
if (categoryName == AllSubCommand)
{
@@ -107,7 +111,9 @@ namespace OpenSim.Framework.Monitoring
else
{
if (String.IsNullOrEmpty(containerName))
+ {
OutputCategoryStatsToConsole(con, category);
+ }
else
{
SortedDictionary container;