aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring/StatsManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Monitoring/StatsManager.cs')
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 05ee4c5..8fcbdca 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -99,6 +99,7 @@ namespace OpenSim.Framework.Monitoring
99 99
100 string categoryName = components[0]; 100 string categoryName = components[0];
101 string containerName = components.Length > 1 ? components[1] : null; 101 string containerName = components.Length > 1 ? components[1] : null;
102 string statName = components.Length > 2 ? components[2] : null;
102 103
103 if (categoryName == AllSubCommand) 104 if (categoryName == AllSubCommand)
104 { 105 {
@@ -128,7 +129,23 @@ namespace OpenSim.Framework.Monitoring
128 SortedDictionary<string, Stat> container; 129 SortedDictionary<string, Stat> container;
129 if (category.TryGetValue(containerName, out container)) 130 if (category.TryGetValue(containerName, out container))
130 { 131 {
131 OutputContainerStatsToConsole(con, container); 132 if (String.IsNullOrEmpty(statName))
133 {
134 OutputContainerStatsToConsole(con, container);
135 }
136 else
137 {
138 Stat stat;
139 if (container.TryGetValue(statName, out stat))
140 {
141 OutputStatToConsole(con, stat);
142 }
143 else
144 {
145 con.OutputFormat(
146 "No such stat {0} in {1}.{2}", statName, categoryName, containerName);
147 }
148 }
132 } 149 }
133 else 150 else
134 { 151 {
@@ -200,6 +217,11 @@ namespace OpenSim.Framework.Monitoring
200 con.Output(report); 217 con.Output(report);
201 } 218 }
202 219
220 private static void OutputStatToConsole(ICommandConsole con, Stat stat)
221 {
222 con.Output(stat.ToConsoleString());
223 }
224
203 // Creates an OSDMap of the format: 225 // Creates an OSDMap of the format:
204 // { categoryName: { 226 // { categoryName: {
205 // containerName: { 227 // containerName: {