From 881f295e702ac30244803fddedef70b242084914 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 30 Jan 2008 22:13:47 +0000
Subject: * Add 'asset not found' statistics to grid asset server stats
---
OpenSim/Grid/AssetServer/RestService.cs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Grid/AssetServer')
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs
index 13970e7..9b288a7 100644
--- a/OpenSim/Grid/AssetServer/RestService.cs
+++ b/OpenSim/Grid/AssetServer/RestService.cs
@@ -45,6 +45,12 @@ namespace OpenSim.Grid.AssetServer
private IAssetProvider m_assetProvider;
private AssetStatsReporter m_stats;
+ ///
+ /// Constructor.
+ ///
+ ///
+ ///
+ /// Can be null if stats collection isn't required
public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider,
AssetStatsReporter stats)
: base("GET", "/assets")
@@ -73,8 +79,9 @@ namespace OpenSim.Grid.AssetServer
"REST", "GET:/asset ignoring request with malformed UUID {0}", p[0]);
return result;
}
-
- m_stats.AddRequest();
+
+ if (m_stats != null)
+ m_stats.AddRequest();
AssetBase asset = m_assetProvider.FetchAsset(assetID);
if (asset != null)
@@ -100,6 +107,9 @@ namespace OpenSim.Grid.AssetServer
}
else
{
+ if (m_stats != null)
+ m_stats.AddNotFoundRequest();
+
MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID);
}
}
--
cgit v1.1