diff options
author | Robert Adams | 2013-02-23 17:04:19 -0800 |
---|---|---|
committer | Robert Adams | 2013-02-24 07:48:00 -0800 |
commit | ee8d726ec5cbcbaca8aebbcbfd25cfba963c43f8 (patch) | |
tree | 08d9daca49351b442161df88df83b928c23c8327 /OpenSim/Framework/Monitoring/StatsManager.cs | |
parent | Addition of ServerStats shared region module which collects and registers (diff) | |
download | opensim-SC-ee8d726ec5cbcbaca8aebbcbfd25cfba963c43f8.zip opensim-SC-ee8d726ec5cbcbaca8aebbcbfd25cfba963c43f8.tar.gz opensim-SC-ee8d726ec5cbcbaca8aebbcbfd25cfba963c43f8.tar.bz2 opensim-SC-ee8d726ec5cbcbaca8aebbcbfd25cfba963c43f8.tar.xz |
Modify StatsManager so console command "show stats category container"
only outputs the statistics in the specified container in the category.
Diffstat (limited to 'OpenSim/Framework/Monitoring/StatsManager.cs')
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 910907e..24db6d4 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs | |||
@@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring | |||
85 | if (cmd.Length > 2) | 85 | if (cmd.Length > 2) |
86 | { | 86 | { |
87 | var categoryName = cmd[2]; | 87 | var categoryName = cmd[2]; |
88 | var containerName = cmd.Length > 3 ? cmd[3] : String.Empty; | ||
88 | 89 | ||
89 | if (categoryName == AllSubCommand) | 90 | if (categoryName == AllSubCommand) |
90 | { | 91 | { |
@@ -108,7 +109,20 @@ namespace OpenSim.Framework.Monitoring | |||
108 | } | 109 | } |
109 | else | 110 | else |
110 | { | 111 | { |
111 | OutputCategoryStatsToConsole(con, category); | 112 | if (String.IsNullOrEmpty(containerName)) |
113 | OutputCategoryStatsToConsole(con, category); | ||
114 | else | ||
115 | { | ||
116 | SortedDictionary<string, Stat> container; | ||
117 | if (category.TryGetValue(containerName, out container)) | ||
118 | { | ||
119 | OutputContainerStatsToConsole(con, container); | ||
120 | } | ||
121 | else | ||
122 | { | ||
123 | con.OutputFormat("No such container {0} in category {1}", containerName, categoryName); | ||
124 | } | ||
125 | } | ||
112 | } | 126 | } |
113 | } | 127 | } |
114 | } | 128 | } |
@@ -124,10 +138,15 @@ namespace OpenSim.Framework.Monitoring | |||
124 | { | 138 | { |
125 | foreach (var container in category.Values) | 139 | foreach (var container in category.Values) |
126 | { | 140 | { |
127 | foreach (Stat stat in container.Values) | 141 | OutputContainerStatsToConsole(con, container); |
128 | { | 142 | } |
129 | con.Output(stat.ToConsoleString()); | 143 | } |
130 | } | 144 | |
145 | private static void OutputContainerStatsToConsole( ICommandConsole con, SortedDictionary<string, Stat> container) | ||
146 | { | ||
147 | foreach (Stat stat in container.Values) | ||
148 | { | ||
149 | con.Output(stat.ToConsoleString()); | ||
131 | } | 150 | } |
132 | } | 151 | } |
133 | 152 | ||