* Refactor: Renaming non viewer statistics classes from Reporters to Collectors - this seems more intuitive
parent
e45ace9b54
commit
56faeafdae
|
@ -31,9 +31,9 @@ using System.Timers;
|
||||||
namespace OpenSim.Framework.Statistics
|
namespace OpenSim.Framework.Statistics
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Collects and reports information on the requests made to the asset server
|
/// Asset service statistics collection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AssetStatsReporter
|
public class AssetStatsCollector
|
||||||
{
|
{
|
||||||
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
|
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
|
||||||
private DateTime startTime = DateTime.Now;
|
private DateTime startTime = DateTime.Now;
|
||||||
|
@ -48,7 +48,7 @@ namespace OpenSim.Framework.Statistics
|
||||||
public long AssetRequestsYesterday { get { return assetRequestsYesterday; } }
|
public long AssetRequestsYesterday { get { return assetRequestsYesterday; } }
|
||||||
public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } }
|
public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } }
|
||||||
|
|
||||||
public AssetStatsReporter()
|
public AssetStatsCollector()
|
||||||
{
|
{
|
||||||
ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing);
|
ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing);
|
||||||
ageStatsTimer.Enabled = true;
|
ageStatsTimer.Enabled = true;
|
|
@ -28,7 +28,7 @@
|
||||||
namespace OpenSim.Framework.Statistics.Interfaces
|
namespace OpenSim.Framework.Statistics.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of IPullStatsProvider.
|
/// Implemented by objects which allow statistical information to be pulled from them.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IPullStatsProvider
|
public interface IPullStatsProvider
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,10 @@ using OpenSim.Framework.Statistics.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Statistics
|
namespace OpenSim.Framework.Statistics
|
||||||
{
|
{
|
||||||
public class SimExtraStatsReporter
|
/// <summary>
|
||||||
|
/// Collects sim statistics which aren't already being collected for the linden viewer's statistics pane
|
||||||
|
/// </summary>
|
||||||
|
public class SimExtraStatsCollector
|
||||||
{
|
{
|
||||||
private long assetsInCache;
|
private long assetsInCache;
|
||||||
private long texturesInCache;
|
private long texturesInCache;
|
||||||
|
@ -48,8 +51,8 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retain a dictionary of all packet queues stats reporters
|
/// Retain a dictionary of all packet queues stats reporters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private IDictionary<LLUUID, PacketQueueStatsReporter> packetQueueStatsReporters
|
private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors
|
||||||
= new Dictionary<LLUUID, PacketQueueStatsReporter>();
|
= new Dictionary<LLUUID, PacketQueueStatsCollector>();
|
||||||
|
|
||||||
public void AddAsset(AssetBase asset)
|
public void AddAsset(AssetBase asset)
|
||||||
{
|
{
|
||||||
|
@ -74,9 +77,9 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// <param name="provider"></param>
|
/// <param name="provider"></param>
|
||||||
public void RegisterPacketQueueStatsProvider(LLUUID uuid, IPullStatsProvider provider)
|
public void RegisterPacketQueueStatsProvider(LLUUID uuid, IPullStatsProvider provider)
|
||||||
{
|
{
|
||||||
lock (packetQueueStatsReporters)
|
lock (packetQueueStatsCollectors)
|
||||||
{
|
{
|
||||||
packetQueueStatsReporters[uuid] = new PacketQueueStatsReporter(provider);
|
packetQueueStatsCollectors[uuid] = new PacketQueueStatsCollector(provider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,9 +89,9 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// <param name="uuid">An agent LLUUID</param>
|
/// <param name="uuid">An agent LLUUID</param>
|
||||||
public void DeregisterPacketQueueStatsProvider(LLUUID uuid)
|
public void DeregisterPacketQueueStatsProvider(LLUUID uuid)
|
||||||
{
|
{
|
||||||
lock (packetQueueStatsReporters)
|
lock (packetQueueStatsCollectors)
|
||||||
{
|
{
|
||||||
packetQueueStatsReporters.Remove(uuid);
|
packetQueueStatsCollectors.Remove(uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,10 +121,10 @@ Texture cache contains {2,6} textures using {3,10:0.000}K" + Environment.NewLine
|
||||||
"Send", "In", "Out", "Resend", "Land", "Wind", "Cloud", "Task", "Texture", "Asset"));
|
"Send", "In", "Out", "Resend", "Land", "Wind", "Cloud", "Task", "Texture", "Asset"));
|
||||||
sb.Append(Environment.NewLine);
|
sb.Append(Environment.NewLine);
|
||||||
|
|
||||||
foreach (LLUUID key in packetQueueStatsReporters.Keys)
|
foreach (LLUUID key in packetQueueStatsCollectors.Keys)
|
||||||
{
|
{
|
||||||
sb.Append(string.Format("{0}: ", key));
|
sb.Append(string.Format("{0}: ", key));
|
||||||
sb.Append(packetQueueStatsReporters[key].Report());
|
sb.Append(packetQueueStatsCollectors[key].Report());
|
||||||
sb.Append(Environment.NewLine);
|
sb.Append(Environment.NewLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,11 +135,11 @@ Texture cache contains {2,6} textures using {3,10:0.000}K" + Environment.NewLine
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Pull packet queue stats from packet queues and report
|
/// Pull packet queue stats from packet queues and report
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PacketQueueStatsReporter
|
public class PacketQueueStatsCollector
|
||||||
{
|
{
|
||||||
private IPullStatsProvider m_statsProvider;
|
private IPullStatsProvider m_statsProvider;
|
||||||
|
|
||||||
public PacketQueueStatsReporter(IPullStatsProvider provider)
|
public PacketQueueStatsCollector(IPullStatsProvider provider)
|
||||||
{
|
{
|
||||||
m_statsProvider = provider;
|
m_statsProvider = provider;
|
||||||
}
|
}
|
|
@ -32,13 +32,13 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StatsManager
|
public class StatsManager
|
||||||
{
|
{
|
||||||
private static AssetStatsReporter assetStats;
|
private static AssetStatsCollector assetStats;
|
||||||
private static UserStatsReporter userStats;
|
private static UserStatsCollector userStats;
|
||||||
private static SimExtraStatsReporter simExtraStats;
|
private static SimExtraStatsCollector simExtraStats;
|
||||||
|
|
||||||
public static AssetStatsReporter AssetStats { get { return assetStats; } }
|
public static AssetStatsCollector AssetStats { get { return assetStats; } }
|
||||||
public static UserStatsReporter UserStats { get { return userStats; } }
|
public static UserStatsCollector UserStats { get { return userStats; } }
|
||||||
public static SimExtraStatsReporter SimExtraStats { get { return simExtraStats; } }
|
public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } }
|
||||||
|
|
||||||
private StatsManager() {}
|
private StatsManager() {}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void StartCollectingAssetStats()
|
public static void StartCollectingAssetStats()
|
||||||
{
|
{
|
||||||
assetStats = new AssetStatsReporter();
|
assetStats = new AssetStatsCollector();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -57,7 +57,7 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void StartCollectingUserStats()
|
public static void StartCollectingUserStats()
|
||||||
{
|
{
|
||||||
userStats = new UserStatsReporter();
|
userStats = new UserStatsCollector();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -66,7 +66,7 @@ namespace OpenSim.Framework.Statistics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void StartCollectingSimExtraStats()
|
public static void StartCollectingSimExtraStats()
|
||||||
{
|
{
|
||||||
simExtraStats = new SimExtraStatsReporter();
|
simExtraStats = new SimExtraStatsCollector();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ using System.Timers;
|
||||||
namespace OpenSim.Framework.Statistics
|
namespace OpenSim.Framework.Statistics
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of UserStatsReporter.
|
/// Collects user service statistics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UserStatsReporter
|
public class UserStatsCollector
|
||||||
{
|
{
|
||||||
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
|
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace OpenSim.Framework.Statistics
|
||||||
private int logouts;
|
private int logouts;
|
||||||
public int Logouts { get { return logouts; } }
|
public int Logouts { get { return logouts; } }
|
||||||
|
|
||||||
public UserStatsReporter()
|
public UserStatsCollector()
|
||||||
{
|
{
|
||||||
ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing);
|
ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing);
|
||||||
ageStatsTimer.Enabled = true;
|
ageStatsTimer.Enabled = true;
|
Loading…
Reference in New Issue