Class PerformancePlugin
Tracks potential performance problems in the server and generates a report. Eventually we can make these reports output from the server and track them across builds.
Inheritance
System.Object
PerformancePlugin
Assembly: Eco.Core.dll
public class PerformancePlugin : Singleton<PerformancePlugin>, IHasDisplayTabs, IInitializablePlugin, IThreadedPlugin, IShutdownablePlugin, IConfigurablePlugin, IEditablePlugin, IGUIPlugin, IServerPlugin
Constructors
Declaration
public PerformancePlugin()
Fields
Declaration
public static int[] IntervalCounters
Field Value
Type |
Description |
System.Int32[] |
|
Configured interval times used by the PerformancePlugin. These values must be multiples of each other.
Declaration
public static readonly double[] IntervalTimes
Field Value
Type |
Description |
System.Double[] |
|
Properties
Flag to collect controller stats when a data is being captured or the controller stats tab is open.
Declaration
public bool CollectControllerStats { get; }
Property Value
Type |
Description |
System.Boolean |
|
Declaration
public PerformanceConfig Config { get; }
Property Value
Declaration
public IEnumerable<IDisplayTab> DisplayTabs { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<IDisplayTab> |
|
Declaration
public ThreadSafeAction<object, string> ParamChanged { get; set; }
Property Value
Declaration
public IPluginConfig PluginConfig { get; }
Property Value
Methods
Registers a new metric collector with the performance plugin instance.
Declaration
public void AddMetricCollector<T>()
where T : IMetricCollector, new()
Type Parameters
Declaration
public string GetCategory()
Returns
Type |
Description |
System.String |
|
Returns the Controller Metrics report for displaying on the "Controller Stats" DisplayTab for the server GUI.
Declaration
public string GetControllerMetricsReport()
Returns
Type |
Description |
System.String |
|
Declaration
public string GetCountOfObjectsReport()
Returns
Type |
Description |
System.String |
|
Declaration
public object GetEditObject()
Returns
Type |
Description |
System.Object |
|
Generates and returns the report used in the "Metrics Stats" DisplayTab for the server GUI.
Declaration
public string GetMetricsReport()
Returns
Type |
Description |
System.String |
|
Retrieves the currently stored metrics and metrics being tracked by our PerformanceManager instance for use in external metric publishing.
Declaration
public Dictionary<string, double> GetMonitoredMetrics()
Returns
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Double> |
|
Returns the PerformanceManager GetReport results for displaying on the "Performance Manager" DisplayTab for the server GUI.
Declaration
public string GetPerformanceManagerReport()
Returns
Type |
Description |
System.String |
|
Declaration
public string GetRepeatedNotificationsReport()
Returns
Type |
Description |
System.String |
|
Declaration
public string GetStatus()
Returns
Type |
Description |
System.String |
|
This one is exposed via API to provide the historical data of metrics.
Declaration
public string GetStoredMetrics()
Returns
Type |
Description |
System.String |
|
Retrieves the generic key/value metric currently being stored for reports/publishing.
Declaration
public double GetValueMetric(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
Name of the metric to retrieve
|
Returns
Type |
Description |
System.Double |
Stored value if the metric exists. Otherwise 0.
|
Declaration
public bool HasMetricCollector(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
public void Initialize(TimedTask timer)
Parameters
Declaration
public void OnEditObjectChanged(object o, string param)
Parameters
Type |
Name |
Description |
System.Object |
o |
|
System.String |
param |
|
Removes an existing metric collector instance from the performance plugin.
Declaration
public void RemoveMetricCollector(Type type)
Parameters
Starts our IWorker instance for generating performance reports.
Declaration
Enable/disable performance reports data collection
Declaration
public void SetCaptureData(bool enable)
Parameters
Type |
Name |
Description |
System.Boolean |
enable |
|
Declaration
public Task ShutdownAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Declaration
public void StoreIntervalMetric(string name, int count, double ms, int controllerId, int playerId)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Int32 |
count |
|
System.Double |
ms |
|
System.Int32 |
controllerId |
|
System.Int32 |
playerId |
|
Stores a generic key/value metric for generating reports/publishing to external sources.
Declaration
public void StoreValueMetric(string name, double value)
Parameters
Type |
Name |
Description |
System.String |
name |
Name of the metric to store
|
System.Double |
value |
Current value of the metric.
|
Returns a string that represnets this object. Used by the Eco server to properly localize the plugin instance.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
Returns a string that represnets this object.
|
Implements
Extension Methods