diff options
author | Justin Clark-Casey (justincc) | 2013-08-06 18:29:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-08-06 18:29:33 +0100 |
commit | 4c2f6de8e4957df3c7186437089ba0925edb1a08 (patch) | |
tree | dd8e8afc6df95ce556b08b84ea29fba78f8ddb3c /OpenSim/Framework | |
parent | Add "debug threadpool status" console command to show min/max/current worker/... (diff) | |
download | opensim-SC_OLD-4c2f6de8e4957df3c7186437089ba0925edb1a08.zip opensim-SC_OLD-4c2f6de8e4957df3c7186437089ba0925edb1a08.tar.gz opensim-SC_OLD-4c2f6de8e4957df3c7186437089ba0925edb1a08.tar.bz2 opensim-SC_OLD-4c2f6de8e4957df3c7186437089ba0925edb1a08.tar.xz |
Add the experimental ability to dump stats (result of command "show stats all") to file OpenSimStats.log every 5 seconds.
This can currently only be activated with the console command "debug stats record start".
Off by default.
Records to file OpenSimStats.log for simulator and RobustStats.log for ROBUST
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Monitoring/StatsManager.cs | 52 |
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: |