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/Framework/Statistics/AssetStatsReporter.cs | 31 ++++++++++++++++------
1 file changed, 23 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Framework/Statistics/AssetStatsReporter.cs')
diff --git a/OpenSim/Framework/Statistics/AssetStatsReporter.cs b/OpenSim/Framework/Statistics/AssetStatsReporter.cs
index 4489c65..bcd3a75 100644
--- a/OpenSim/Framework/Statistics/AssetStatsReporter.cs
+++ b/OpenSim/Framework/Statistics/AssetStatsReporter.cs
@@ -40,11 +40,15 @@ namespace OpenSim.Grid.AssetServer
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
private DateTime startTime = DateTime.Now;
- private long assetRequestsToday;
+ private long assetRequestsToday;
+ private long assetRequestsNotFoundToday;
private long assetRequestsYesterday;
+ private long assetRequestsNotFoundYesterday;
- public long AssetRequestsToday { get { return assetRequestsToday; } }
- public long AssetRequestsYesterday { get { return assetRequestsYesterday; } }
+ public long AssetRequestsToday { get { return assetRequestsToday; } }
+ public long AssetRequestsNotFoundToday { get { return assetRequestsNotFoundToday; } }
+ public long AssetRequestsYesterday { get { return assetRequestsYesterday; } }
+ public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } }
public AssetStatsReporter()
{
@@ -58,7 +62,18 @@ namespace OpenSim.Grid.AssetServer
// There is a possibility that an asset request could occur between the execution of these
// two statements. But we're better off without the synchronization overhead.
- assetRequestsToday = 0;
+ assetRequestsToday = 0;
+
+ assetRequestsNotFoundYesterday = assetRequestsNotFoundToday;
+ assetRequestsNotFoundToday = 0;
+ }
+
+ ///
+ /// Record that an asset request failed to find an asset
+ ///
+ public void AddNotFoundRequest()
+ {
+ assetRequestsNotFoundToday++;
}
///
@@ -82,10 +97,10 @@ namespace OpenSim.Grid.AssetServer
long assetRequestsYesterdayPerHour = (long)Math.Round(AssetRequestsYesterday / 24.0);
return string.Format(
-@"Asset requests today : {0} ({1} per hour)
-Asset requests yesterday : {2} ({3} per hour)",
- AssetRequestsToday, assetRequestsTodayPerHour,
- AssetRequestsYesterday, assetRequestsYesterdayPerHour);
+@"Asset requests today : {0} ({1} per hour) of which {2} were not found
+Asset requests yesterday : {3} ({4} per hour) of which {5} were not found",
+ AssetRequestsToday, assetRequestsTodayPerHour, AssetRequestsNotFoundToday,
+ AssetRequestsYesterday, assetRequestsYesterdayPerHour, AssetRequestsNotFoundYesterday);
}
}
}
--
cgit v1.1