* 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
This commit is contained in:
Justin Clarke Casey
2008-01-25 19:24:25 +00:00
parent f96d6ea2cd
commit 90c853685c
10 changed files with 206 additions and 22 deletions

View File

@@ -53,7 +53,7 @@ namespace OpenSim.Grid.AssetServer
private IAssetProvider m_assetProvider;
private AssetStatsReporter stats;
protected AssetStatsReporter m_stats;
[STAThread]
public static void Main(string[] args)
@@ -100,10 +100,9 @@ namespace OpenSim.Grid.AssetServer
m_console.Verbose("ASSET", "Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
// XXX Hardcoded - could be a plugin later on
stats = new AssetStatsReporter();
m_stats = new AssetStatsReporter();
httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider, stats));
httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider, m_stats));
httpServer.AddStreamHandler(new PostAssetStreamHandler(this, m_assetProvider));
httpServer.Start();
@@ -179,12 +178,12 @@ namespace OpenSim.Grid.AssetServer
case "help":
m_console.Notice(
@"shutdown - shutdown this asset server (USE CAUTION!)
stats - statistical information for this asset server");
stats - statistical information for this server");
break;
case "stats":
MainLog.Instance.Notice("STATS", Environment.NewLine + stats.Report());
MainLog.Instance.Notice("STATS", Environment.NewLine + m_stats.Report());
break;
case "shutdown":