aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-13 16:58:24 +0000
committerJustin Clarke Casey2008-06-13 16:58:24 +0000
commitb799031010b978e3edaf9f128e31b498cff72afc (patch)
tree15f752be86885f68e21861865d33f3a4569bf21d /OpenSim/Framework
parent* Double timeout on region registration XMLRPC call to the grid service (diff)
downloadopensim-SC_OLD-b799031010b978e3edaf9f128e31b498cff72afc.zip
opensim-SC_OLD-b799031010b978e3edaf9f128e31b498cff72afc.tar.gz
opensim-SC_OLD-b799031010b978e3edaf9f128e31b498cff72afc.tar.bz2
opensim-SC_OLD-b799031010b978e3edaf9f128e31b498cff72afc.tar.xz
* minor: Print out uptime as well as stats in periodic diagnostics logging, so it's easier to tell which isntances each print out of information is from
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs4
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs32
2 files changed, 30 insertions, 6 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index ce351ca..a69cb63 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -558,7 +558,9 @@ namespace OpenSim.Framework.Servers
558 Encoding encoding = Encoding.UTF8; 558 Encoding encoding = Encoding.UTF8;
559 StreamReader reader = new StreamReader(requestStream, encoding); 559 StreamReader reader = new StreamReader(requestStream, encoding);
560 560
561 string requestBody = reader.ReadToEnd(); 561 //string requestBody = reader.ReadToEnd();
562 // avoid warning for now
563 reader.ReadToEnd();
562 reader.Close(); 564 reader.Close();
563 requestStream.Close(); 565 requestStream.Close();
564 566
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 433b040..62ff095 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.Text;
31using System.Timers; 32using System.Timers;
32using log4net; 33using log4net;
33using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
@@ -46,7 +47,7 @@ namespace OpenSim.Framework.Servers
46 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this 47 /// This will control a periodic log printout of the current 'show stats' (if they are active) for this
47 /// server. 48 /// server.
48 /// </summary> 49 /// </summary>
49 private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000); 50 private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
50 51
51 protected ConsoleBase m_console; 52 protected ConsoleBase m_console;
52 53
@@ -81,19 +82,37 @@ namespace OpenSim.Framework.Servers
81 m_startuptime = DateTime.Now; 82 m_startuptime = DateTime.Now;
82 m_version = VersionInfo.Version; 83 m_version = VersionInfo.Version;
83 84
84 m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats); 85 m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
85 m_periodicLogStatsTimer.Enabled = true; 86 m_periodicDiagnosticsTimer.Enabled = true;
86 } 87 }
87 88
88 /// <summary> 89 /// <summary>
89 /// Print statistics to the logfile, if they are active 90 /// Print statistics to the logfile, if they are active
90 /// </summary> 91 /// </summary>
91 protected void LogStats(object source, ElapsedEventArgs e) 92 protected void LogDiagnostics(object source, ElapsedEventArgs e)
92 { 93 {
94 StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n");
95 sb.Append(GetUptimeReport());
96
93 if (m_stats != null) 97 if (m_stats != null)
94 { 98 {
95 m_log.Info(m_stats.Report()); 99 sb.Append(m_stats.Report());
96 } 100 }
101
102 m_log.Debug(sb);
103 }
104
105 /// <summary>
106 /// Return a report about the uptime of this server
107 /// </summary>
108 /// <returns></returns>
109 protected string GetUptimeReport()
110 {
111 StringBuilder sb = new StringBuilder(String.Format("Time now is {0}\n", DateTime.Now));
112 sb.Append(String.Format("Server has been running since {0}, {1}\n", m_startuptime.DayOfWeek, m_startuptime));
113 sb.Append(String.Format("That is an elapsed time of {0}\n", DateTime.Now - m_startuptime));
114
115 return sb.ToString();
97 } 116 }
98 117
99 /// <summary> 118 /// <summary>
@@ -176,9 +195,12 @@ namespace OpenSim.Framework.Servers
176 break; 195 break;
177 196
178 case "uptime": 197 case "uptime":
198 Notice(GetUptimeReport());
199 /*
179 Notice("Time now is " + DateTime.Now); 200 Notice("Time now is " + DateTime.Now);
180 Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString()); 201 Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString());
181 Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString()); 202 Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString());
203 */
182 break; 204 break;
183 205
184 case "version": 206 case "version":