aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-03-18 20:21:47 +0000
committerJustin Clark-Casey (justincc)2014-03-18 20:21:47 +0000
commit8ce3fa646b4da171d96784935ba5a39ea65dd70a (patch)
treefc5036727a92ea26ab9490f945e3d8c079df98fd /OpenSim/Framework/Monitoring
parentAdd scene.<scene-name>.QueuedFetchInventoryRequests stat (diff)
downloadopensim-SC_OLD-8ce3fa646b4da171d96784935ba5a39ea65dd70a.zip
opensim-SC_OLD-8ce3fa646b4da171d96784935ba5a39ea65dd70a.tar.gz
opensim-SC_OLD-8ce3fa646b4da171d96784935ba5a39ea65dd70a.tar.bz2
opensim-SC_OLD-8ce3fa646b4da171d96784935ba5a39ea65dd70a.tar.xz
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"
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-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: {