aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-10 23:19:38 +0000
committerJustin Clarke Casey2008-06-10 23:19:38 +0000
commit686f16cedda4daac1663f30b17e65bde7fc4af2b (patch)
tree84d007bdf777fe5a7569b32198e3d18347178c1e /OpenSim/Framework/Servers/BaseOpenSimServer.cs
parentI'm going to need the Version property to manage (diff)
downloadopensim-SC_OLD-686f16cedda4daac1663f30b17e65bde7fc4af2b.zip
opensim-SC_OLD-686f16cedda4daac1663f30b17e65bde7fc4af2b.tar.gz
opensim-SC_OLD-686f16cedda4daac1663f30b17e65bde7fc4af2b.tar.bz2
opensim-SC_OLD-686f16cedda4daac1663f30b17e65bde7fc4af2b.tar.xz
* If a server has statistics, print these out to the log every hour to get some idea of how these evolve
* When returning GC.GetTotalMemory(), force collection first in order to get more accurate figures
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 0ee21ac..852e1b1 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Reflection; 30using System.Reflection;
31using System.Timers;
31using log4net; 32using log4net;
32using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
33using OpenSim.Framework.Statistics; 34using OpenSim.Framework.Statistics;
@@ -41,6 +42,12 @@ namespace OpenSim.Framework.Servers
41 { 42 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 44
45 /// <summary>
46 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this
47 /// server.
48 /// </summary>
49 private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000);
50
44 protected ConsoleBase m_console; 51 protected ConsoleBase m_console;
45 52
46 /// <summary> 53 /// <summary>
@@ -68,6 +75,20 @@ namespace OpenSim.Framework.Servers
68 { 75 {
69 m_startuptime = DateTime.Now; 76 m_startuptime = DateTime.Now;
70 m_version = VersionInfo.Version; 77 m_version = VersionInfo.Version;
78
79 m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats);
80 m_periodicLogStatsTimer.Enabled = true;
81 }
82
83 /// <summary>
84 /// Print statistics to the logfile, if they are active
85 /// </summary>
86 protected void LogStats(object source, ElapsedEventArgs e)
87 {
88 if (m_stats != null)
89 {
90 m_log.Info(m_stats.Report());
91 }
71 } 92 }
72 93
73 /// <summary> 94 /// <summary>