aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetServer/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/AssetServer/Main.cs')
-rw-r--r--OpenSim/Grid/AssetServer/Main.cs18
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs
index ed77e3e..4fc66f7 100644
--- a/OpenSim/Grid/AssetServer/Main.cs
+++ b/OpenSim/Grid/AssetServer/Main.cs
@@ -52,6 +52,8 @@ namespace OpenSim.Grid.AssetServer
52 protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); 52 protected IAssetLoader assetLoader = new AssetLoaderFileSystem();
53 53
54 private IAssetProvider m_assetProvider; 54 private IAssetProvider m_assetProvider;
55
56 private AssetStatsReporter stats;
55 57
56 [STAThread] 58 [STAThread]
57 public static void Main(string[] args) 59 public static void Main(string[] args)
@@ -97,8 +99,11 @@ namespace OpenSim.Grid.AssetServer
97 99
98 m_console.Verbose("ASSET", "Starting HTTP process"); 100 m_console.Verbose("ASSET", "Starting HTTP process");
99 BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); 101 BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
102
103 // XXX Hardcoded - could be a plugin later on
104 stats = new AssetStatsReporter();
100 105
101 httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider)); 106 httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider, stats));
102 httpServer.AddStreamHandler(new PostAssetStreamHandler(this, m_assetProvider)); 107 httpServer.AddStreamHandler(new PostAssetStreamHandler(this, m_assetProvider));
103 108
104 httpServer.Start(); 109 httpServer.Start();
@@ -172,7 +177,14 @@ namespace OpenSim.Grid.AssetServer
172 switch (cmd) 177 switch (cmd)
173 { 178 {
174 case "help": 179 case "help":
175 m_console.Notice("shutdown - shutdown this asset server (USE CAUTION!)"); 180 m_console.Notice(
181 @"shutdown - shutdown this asset server (USE CAUTION!)
182 stats - statistical information for this asset server");
183
184 break;
185
186 case "stats":
187 MainLog.Instance.Notice("STATS", Environment.NewLine + stats.Report());
176 break; 188 break;
177 189
178 case "shutdown": 190 case "shutdown":
@@ -186,4 +198,4 @@ namespace OpenSim.Grid.AssetServer
186 { 198 {
187 } 199 }
188 } 200 }
189} \ No newline at end of file 201}