Refactor only: serve stats objects directly through StatsManager singleton

This commit is contained in:
Justin Clarke Casey
2008-02-04 16:22:58 +00:00
parent ffaf160362
commit a1c9349d47
13 changed files with 59 additions and 74 deletions

View File

@@ -30,7 +30,7 @@ using System;
using System.Text;
using System.Timers;
namespace OpenSim.Grid.AssetServer
namespace OpenSim.Framework.Statistics
{
/// <summary>
/// Collects and reports information on the requests made to the asset server

View File

@@ -33,19 +33,39 @@ namespace OpenSim.Framework.Statistics
/// </summary>
public class StatsManager
{
private static AssetStatsReporter assetStats;
private static UserStatsReporter userStats;
private static SimExtraStatsReporter simExtraStats;
public static AssetStatsReporter AssetStats { get { return assetStats; } }
public static UserStatsReporter UserStats { get { return userStats; } }
public static SimExtraStatsReporter SimExtraStats { get { return simExtraStats; } }
private StatsManager()
private StatsManager() {}
/// <summary>
/// Start collecting statistics related to assets.
/// Should only be called once.
/// </summary>
public static void StartCollectingAssetStats()
{
assetStats = new AssetStatsReporter();
}
/// <summary>
/// Start recording statistics. Should only be called once - calling again will reset statistic
/// counts.
/// Start collecting statistics related to users.
/// Should only be called once.
/// </summary>
public static void StartCollectingUserStats()
{
userStats = new UserStatsReporter();
}
/// <summary>
/// Start collecting extra sim statistics apart from those collected for the client.
/// Should only be called once.
/// </summary>
public static void StartCollecting()
public static void StartCollectingSimExtraStats()
{
simExtraStats = new SimExtraStatsReporter();
}