aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/UserStatistics
diff options
context:
space:
mode:
authorTeravus Ovares2009-01-07 23:35:11 +0000
committerTeravus Ovares2009-01-07 23:35:11 +0000
commit437d2f8703c12684a624719941e0611966ebcdaf (patch)
treee714b82e56ff3ebc25490c7734fdb73383edce69 /OpenSim/Region/UserStatistics
parent* Added session report. (diff)
downloadopensim-SC_OLD-437d2f8703c12684a624719941e0611966ebcdaf.zip
opensim-SC_OLD-437d2f8703c12684a624719941e0611966ebcdaf.tar.gz
opensim-SC_OLD-437d2f8703c12684a624719941e0611966ebcdaf.tar.bz2
opensim-SC_OLD-437d2f8703c12684a624719941e0611966ebcdaf.tar.xz
* Add session length to session.report.
Diffstat (limited to 'OpenSim/Region/UserStatistics')
-rw-r--r--OpenSim/Region/UserStatistics/Sessions_Report.cs29
1 files changed, 26 insertions, 3 deletions
diff --git a/OpenSim/Region/UserStatistics/Sessions_Report.cs b/OpenSim/Region/UserStatistics/Sessions_Report.cs
index 2eeb90d..62dc746 100644
--- a/OpenSim/Region/UserStatistics/Sessions_Report.cs
+++ b/OpenSim/Region/UserStatistics/Sessions_Report.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.UserStatistics
79 lock (dbConn) 79 lock (dbConn)
80 { 80 {
81 string sql = 81 string sql =
82 "SELECT distinct a.name_f, a.name_l, a.Agent_ID, b.Session_ID, b.client_version, b.last_updated FROM stats_session_data a LEFT OUTER JOIN stats_session_data b ON a.Agent_ID = b.Agent_ID"; 82 "SELECT distinct a.name_f, a.name_l, a.Agent_ID, b.Session_ID, b.client_version, b.last_updated, b.start_time FROM stats_session_data a LEFT OUTER JOIN stats_session_data b ON a.Agent_ID = b.Agent_ID";
83 83
84 if (puserUUID.Length > 0) 84 if (puserUUID.Length > 0)
85 { 85 {
@@ -136,6 +136,7 @@ namespace OpenSim.Region.UserStatistics
136 ShortSessionData ssd = new ShortSessionData(); 136 ShortSessionData ssd = new ShortSessionData();
137 137
138 ssd.last_update = Utils.UnixTimeToDateTime((uint)Convert.ToInt32(sdr["last_updated"])); 138 ssd.last_update = Utils.UnixTimeToDateTime((uint)Convert.ToInt32(sdr["last_updated"]));
139 ssd.start_time = Utils.UnixTimeToDateTime((uint)Convert.ToInt32(sdr["start_time"]));
139 ssd.session_id = UUID.Parse(sdr["session_id"].ToString()); 140 ssd.session_id = UUID.Parse(sdr["session_id"].ToString());
140 ssd.client_version = sdr["client_version"].ToString(); 141 ssd.client_version = sdr["client_version"].ToString();
141 activeSessionList.sessions.Add(ssd); 142 activeSessionList.sessions.Add(ssd);
@@ -192,13 +193,16 @@ TD.align_top { vertical-align: top; }
192 output.Append("SessionEnd"); 193 output.Append("SessionEnd");
193 HTMLUtil.TD_C(ref output); 194 HTMLUtil.TD_C(ref output);
194 HTMLUtil.TD_O(ref output, "header"); 195 HTMLUtil.TD_O(ref output, "header");
196 output.Append("SessionLength");
197 HTMLUtil.TD_C(ref output);
198 HTMLUtil.TD_O(ref output, "header");
195 output.Append("Client"); 199 output.Append("Client");
196 HTMLUtil.TD_C(ref output); 200 HTMLUtil.TD_C(ref output);
197 HTMLUtil.TR_C(ref output); 201 HTMLUtil.TR_C(ref output);
198 if (lstSession.Count == 0) 202 if (lstSession.Count == 0)
199 { 203 {
200 HTMLUtil.TR_O(ref output, ""); 204 HTMLUtil.TR_O(ref output, "");
201 HTMLUtil.TD_O(ref output, "align_top", 1, 4); 205 HTMLUtil.TD_O(ref output, "align_top", 1, 5);
202 output.Append("No results for that query"); 206 output.Append("No results for that query");
203 HTMLUtil.TD_C(ref output); 207 HTMLUtil.TD_C(ref output);
204 HTMLUtil.TR_C(ref output); 208 HTMLUtil.TR_C(ref output);
@@ -224,13 +228,31 @@ TD.align_top { vertical-align: top; }
224 output.Append(sesdata.last_update.ToShortTimeString()); 228 output.Append(sesdata.last_update.ToShortTimeString());
225 HTMLUtil.TD_C(ref output); 229 HTMLUtil.TD_C(ref output);
226 HTMLUtil.TD_O(ref output, "content"); 230 HTMLUtil.TD_O(ref output, "content");
231 TimeSpan dtlength = sesdata.last_update.Subtract(sesdata.start_time);
232 if (dtlength.Days > 0)
233 {
234 output.Append(dtlength.Days);
235 output.Append(" Days ");
236 }
237 if (dtlength.Hours > 0)
238 {
239 output.Append(dtlength.Hours);
240 output.Append(" Hours ");
241 }
242 if (dtlength.Minutes > 0)
243 {
244 output.Append(dtlength.Minutes);
245 output.Append(" Minutes");
246 }
247 HTMLUtil.TD_C(ref output);
248 HTMLUtil.TD_O(ref output, "content");
227 output.Append(sesdata.client_version); 249 output.Append(sesdata.client_version);
228 HTMLUtil.TD_C(ref output); 250 HTMLUtil.TD_C(ref output);
229 HTMLUtil.TR_C(ref output); 251 HTMLUtil.TR_C(ref output);
230 252
231 } 253 }
232 HTMLUtil.TR_O(ref output, ""); 254 HTMLUtil.TR_O(ref output, "");
233 HTMLUtil.TD_O(ref output, "align_top", 1, 4); 255 HTMLUtil.TD_O(ref output, "align_top", 1, 5);
234 HTMLUtil.HR(ref output, ""); 256 HTMLUtil.HR(ref output, "");
235 HTMLUtil.TD_C(ref output); 257 HTMLUtil.TD_C(ref output);
236 HTMLUtil.TR_C(ref output); 258 HTMLUtil.TR_C(ref output);
@@ -253,6 +275,7 @@ TD.align_top { vertical-align: top; }
253 public UUID session_id; 275 public UUID session_id;
254 public string client_version; 276 public string client_version;
255 public DateTime last_update; 277 public DateTime last_update;
278 public DateTime start_time;
256 } 279 }
257 280
258 #endregion 281 #endregion