aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers
diff options
context:
space:
mode:
authoronefang2019-08-22 15:47:24 +1000
committeronefang2019-08-22 15:47:24 +1000
commit2c4a60c5d686168e54d71b0582b8d78eafec00a1 (patch)
treed676f097c7ac8949bf9765ff62c9060334e1ba2a /OpenSim/Server/Handlers
parentFunction for MYSQL joins. (diff)
downloadopensim-SC_OLD-2c4a60c5d686168e54d71b0582b8d78eafec00a1.zip
opensim-SC_OLD-2c4a60c5d686168e54d71b0582b8d78eafec00a1.tar.gz
opensim-SC_OLD-2c4a60c5d686168e54d71b0582b8d78eafec00a1.tar.bz2
opensim-SC_OLD-2c4a60c5d686168e54d71b0582b8d78eafec00a1.tar.xz
More stats, and an actual stats web page.
Diffstat (limited to 'OpenSim/Server/Handlers')
-rw-r--r--OpenSim/Server/Handlers/Web/WebServerConnector.cs37
1 files changed, 34 insertions, 3 deletions
diff --git a/OpenSim/Server/Handlers/Web/WebServerConnector.cs b/OpenSim/Server/Handlers/Web/WebServerConnector.cs
index 0f328d9..f06d4d8 100644
--- a/OpenSim/Server/Handlers/Web/WebServerConnector.cs
+++ b/OpenSim/Server/Handlers/Web/WebServerConnector.cs
@@ -242,14 +242,45 @@ namespace OpenSim.Server.Handlers.Web
242 return reply; 242 return reply;
243 } 243 }
244 244
245 long locIn = m_database.Count("Presence", "RegionID != '00000000-0000-0000-0000-000000000000'"); // Locals online but not HGing, and HGers in world. 245 long locIn = m_database.Count("Presence", "RegionID != '00000000-0000-0000-0000-000000000000'"); // Locals online but not HGing, and HGers in world.
246 long HGin = m_database.Count("Presence", "UserID NOT IN (SELECT PrincipalID FROM UserAccounts)"); // HGers in world. 246 long HGin = m_database.Count("Presence", "UserID NOT IN (SELECT PrincipalID FROM UserAccounts)"); // HGers in world.
247 ssi["hgers"] = HGin.ToString(); 247 ssi["hgers"] = HGin.ToString();
248 ssi["inworld"] = (locIn - HGin).ToString(); 248 ssi["inworld"] = (locIn - HGin).ToString();
249 ssi["outworld"] = m_database.Count("hg_traveling_data", "GridExternalName != '" + ssi["uri"] + "'").ToString(); // Locals that are HGing. 249 ssi["outworld"] = m_database.Count("hg_traveling_data", "GridExternalName != '" + ssi["uri"] + "'").ToString(); // Locals that are HGing.
250 ssi["members"] = m_database.Count("UserAccounts").ToString(); 250 ssi["members"] = m_database.Count("UserAccounts").ToString();
251 ssi["month"] = m_database.Count("GridUser", "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 2419200))").ToString();
252 ssi["sims"] = m_database.Count("regions").ToString(); 251 ssi["sims"] = m_database.Count("regions").ToString();
252 ssi["onlineSims"] = m_database.Count("regions", "sizeX != 0").ToString();
253 ssi["varRegions"] = m_database.Count("regions", "sizeX > 256 or sizeY > 256").ToString();
254 ssi["singleSims"] = m_database.Count("regions", "sizeX = 256 and sizeY = 256").ToString();
255 ssi["offlineSims"] = m_database.Count("regions", "sizeX = 0").ToString();
256
257 // Calculate grid area.
258 long simSize = 0;
259 List< Hashtable > rows = m_database.Select("regions", "sizeX,sizeY", "sizeX != 0", "");
260 foreach (Hashtable row in rows)
261 {
262 simSize = simSize + Convert.ToInt32(row["sizeX"]) * Convert.ToInt32(row["sizeY"]);
263 }
264 ssi["simsSize"] = simSize.ToString();
265
266 // Count local and HG visitors for the last 30 and 60 days.
267 HGin = m_database.Count("GridUser", "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 2419200))");
268 rows = m_database.Join("GridUser", "GridUser.UserID", "INNER JOIN UserAccounts ON GridUser.UserID = UserAccounts.PrincipalID",
269 "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 2419200))", "");
270 locIn = rows.Count;
271 ssi["locDay30"] = locIn.ToString();
272 ssi["day30"] = HGin.ToString();
273 HGin = HGin - locIn;
274 ssi["HGday30"] = HGin.ToString();
275
276 HGin = m_database.Count("GridUser", "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 4838400))");
277 rows = m_database.Join("GridUser", "GridUser.UserID", "INNER JOIN UserAccounts ON GridUser.UserID = UserAccounts.PrincipalID",
278 "Login > UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()) - 4838400))", "");
279 locIn = rows.Count;
280 ssi["locDay60"] = locIn.ToString();
281 ssi["day60"] = HGin.ToString();
282 HGin = HGin - locIn;
283 ssi["HGday60"] = HGin.ToString();
253 284
254 foreach (DictionaryEntry h in headers) 285 foreach (DictionaryEntry h in headers)
255 { 286 {