aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Monitoring')
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs52
1 files changed, 40 insertions, 12 deletions
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 87197f4..c8e838c 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -81,6 +81,8 @@ namespace OpenSim.Framework.Monitoring
81 + "More than one name can be given separated by spaces.\n" 81 + "More than one name can be given separated by spaces.\n"
82 + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS", 82 + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
83 HandleShowStatsCommand); 83 HandleShowStatsCommand);
84
85 StatsLogger.RegisterConsoleCommands(console);
84 } 86 }
85 87
86 public static void HandleShowStatsCommand(string module, string[] cmd) 88 public static void HandleShowStatsCommand(string module, string[] cmd)
@@ -145,29 +147,55 @@ namespace OpenSim.Framework.Monitoring
145 } 147 }
146 } 148 }
147 149
148 private static void OutputAllStatsToConsole(ICommandConsole con) 150 public static List<string> GetAllStatsReports()
149 { 151 {
152 List<string> reports = new List<string>();
153
150 foreach (var category in RegisteredStats.Values) 154 foreach (var category in RegisteredStats.Values)
151 { 155 reports.AddRange(GetCategoryStatsReports(category));
152 OutputCategoryStatsToConsole(con, category); 156
153 } 157 return reports;
158 }
159
160 private static void OutputAllStatsToConsole(ICommandConsole con)
161 {
162 foreach (string report in GetAllStatsReports())
163 con.Output(report);
164 }
165
166 private static List<string> GetCategoryStatsReports(
167 SortedDictionary<string, SortedDictionary<string, Stat>> category)
168 {
169 List<string> reports = new List<string>();
170
171 foreach (var container in category.Values)
172 reports.AddRange(GetContainerStatsReports(container));
173
174 return reports;
154 } 175 }
155 176
156 private static void OutputCategoryStatsToConsole( 177 private static void OutputCategoryStatsToConsole(
157 ICommandConsole con, SortedDictionary<string, SortedDictionary<string, Stat>> category) 178 ICommandConsole con, SortedDictionary<string, SortedDictionary<string, Stat>> category)
158 { 179 {
159 foreach (var container in category.Values) 180 foreach (string report in GetCategoryStatsReports(category))
160 { 181 con.Output(report);
161 OutputContainerStatsToConsole(con, container);
162 }
163 } 182 }
164 183
165 private static void OutputContainerStatsToConsole( ICommandConsole con, SortedDictionary<string, Stat> container) 184 private static List<string> GetContainerStatsReports(SortedDictionary<string, Stat> container)
166 { 185 {
186 List<string> reports = new List<string>();
187
167 foreach (Stat stat in container.Values) 188 foreach (Stat stat in container.Values)
168 { 189 reports.Add(stat.ToConsoleString());
169 con.Output(stat.ToConsoleString()); 190
170 } 191 return reports;
192 }
193
194 private static void OutputContainerStatsToConsole(
195 ICommandConsole con, SortedDictionary<string, Stat> container)
196 {
197 foreach (string report in GetContainerStatsReports(container))
198 con.Output(report);
171 } 199 }
172 200
173 // Creates an OSDMap of the format: 201 // Creates an OSDMap of the format: