From 90c853685c14e186a3dfd06b7a584d16bf520ccf Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 25 Jan 2008 19:24:25 +0000
Subject: * Add very basic initial login stats to the user server * Typing
'stats' on the command line will given total number of successful logins
today and yesterday * A little bit more to come, probably * Refactoring will
follow next
---
OpenSim/Framework/Communications/LoginService.cs | 26 ++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework/Communications')
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 3a68bfb..1707607 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -38,6 +38,7 @@ using Nwc.XmlRpc;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
+using OpenSim.Framework.Statistics;
namespace OpenSim.Framework.UserManagement
{
@@ -47,16 +48,28 @@ namespace OpenSim.Framework.UserManagement
protected UserManagerBase m_userManager = null;
protected Mutex m_loginMutex = new Mutex(false);
+ protected UserStatsReporter m_statsCollector;
+
///
/// Used during login to send the skeleton of the OpenSim Library to the client.
///
protected LibraryRootFolder m_libraryRootFolder;
- public LoginService(
- UserManagerBase userManager, LibraryRootFolder libraryRootFolder, string welcomeMess)
+ ///
+ /// Constructor
+ ///
+ ///
+ ///
+ ///
+ /// An object for collecting statistical information.
+ /// Can be null if statistics are not required
+ ///
+ public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder,
+ UserStatsReporter statsCollector, string welcomeMess)
{
m_userManager = userManager;
m_libraryRootFolder = libraryRootFolder;
+ m_statsCollector = statsCollector;
if (welcomeMess != String.Empty)
{
@@ -211,6 +224,11 @@ namespace OpenSim.Framework.UserManagement
//return logResponse.ToXmlRpcResponse();
}
CommitAgent(ref userProfile);
+
+ // If we reach this point, then the login has successfully logged onto the grid
+ if (m_statsCollector != null)
+ m_statsCollector.AddSuccessfulLogin();
+
return logResponse.ToXmlRpcResponse();
}
@@ -338,6 +356,10 @@ namespace OpenSim.Framework.UserManagement
}
CommitAgent(ref userProfile);
+
+ // If we reach this point, then the login has successfully logged onto the grid
+ if (m_statsCollector != null)
+ m_statsCollector.AddSuccessfulLogin();
return logResponse.ToLLSDResponse();
}
--
cgit v1.1