mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
Refactor only: serve stats objects directly through StatsManager singleton
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user