From 4c2f6de8e4957df3c7186437089ba0925edb1a08 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 6 Aug 2013 18:29:33 +0100 Subject: [PATCH] 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 --- OpenSim/Framework/Monitoring/StatsManager.cs | 52 +++++++++++++++----- bin/OpenSim.32BitLaunch.exe.config | 36 +++++++++++++- bin/OpenSim.exe.config | 21 ++++++++ bin/Robust.32BitLaunch.exe.config | 22 +++++++++ bin/Robust.exe.config | 21 ++++++++ 5 files changed, 139 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs index 87197f422f..c8e838cadf 100644 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs @@ -81,6 +81,8 @@ namespace OpenSim.Framework.Monitoring + "More than one name can be given separated by spaces.\n" + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS", HandleShowStatsCommand); + + StatsLogger.RegisterConsoleCommands(console); } public static void HandleShowStatsCommand(string module, string[] cmd) @@ -145,29 +147,55 @@ namespace OpenSim.Framework.Monitoring } } + public static List GetAllStatsReports() + { + List reports = new List(); + + foreach (var category in RegisteredStats.Values) + reports.AddRange(GetCategoryStatsReports(category)); + + return reports; + } + private static void OutputAllStatsToConsole(ICommandConsole con) { - foreach (var category in RegisteredStats.Values) - { - OutputCategoryStatsToConsole(con, category); - } + foreach (string report in GetAllStatsReports()) + con.Output(report); + } + + private static List GetCategoryStatsReports( + SortedDictionary> category) + { + List reports = new List(); + + foreach (var container in category.Values) + reports.AddRange(GetContainerStatsReports(container)); + + return reports; } private static void OutputCategoryStatsToConsole( ICommandConsole con, SortedDictionary> category) { - foreach (var container in category.Values) - { - OutputContainerStatsToConsole(con, container); - } + foreach (string report in GetCategoryStatsReports(category)) + con.Output(report); } - private static void OutputContainerStatsToConsole( ICommandConsole con, SortedDictionary container) + private static List GetContainerStatsReports(SortedDictionary container) { + List reports = new List(); + foreach (Stat stat in container.Values) - { - con.Output(stat.ToConsoleString()); - } + reports.Add(stat.ToConsoleString()); + + return reports; + } + + private static void OutputContainerStatsToConsole( + ICommandConsole con, SortedDictionary container) + { + foreach (string report in GetContainerStatsReports(container)) + con.Output(report); } // Creates an OSDMap of the format: diff --git a/bin/OpenSim.32BitLaunch.exe.config b/bin/OpenSim.32BitLaunch.exe.config index 6ac0206e6c..6a6b3c8768 100644 --- a/bin/OpenSim.32BitLaunch.exe.config +++ b/bin/OpenSim.32BitLaunch.exe.config @@ -11,22 +11,56 @@ + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/OpenSim.exe.config b/bin/OpenSim.exe.config index 8a891f4917..b2cb4e5b81 100755 --- a/bin/OpenSim.exe.config +++ b/bin/OpenSim.exe.config @@ -11,6 +11,10 @@ + + + + @@ -21,11 +25,23 @@ + + + + + + + + + + + + @@ -42,5 +58,10 @@ + + + + + diff --git a/bin/Robust.32BitLaunch.exe.config b/bin/Robust.32BitLaunch.exe.config index dae45ffaaa..ec17049a84 100644 --- a/bin/Robust.32BitLaunch.exe.config +++ b/bin/Robust.32BitLaunch.exe.config @@ -11,22 +11,44 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/Robust.exe.config b/bin/Robust.exe.config index 4914f55cb2..62975fd6a1 100644 --- a/bin/Robust.exe.config +++ b/bin/Robust.exe.config @@ -11,6 +11,10 @@ + + + + @@ -19,15 +23,32 @@ + + + + + + + + + + + + + + + + +