Photon Server API
Public Member Functions | Static Public Member Functions | List of all members
ExitGames.Diagnostics.Monitoring.CounterSampleSender Class Reference

Collects data from ICounter instances and publishes the data in a specified interval using an ISocketSender implementation. More...

Inheritance diagram for ExitGames.Diagnostics.Monitoring.CounterSampleSender:
ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase

Public Member Functions

 CounterSampleSender (string senderId, int initialDelay, int sendInterval, int maxRetryCount, ICounterSampleWriter writer)
 Initializes a new instance of the CounterSampleSender class. More...
 
 CounterSampleSender (CounterSampleSenderSettings s)
 Initializes a new instance of the CounterSampleSender class. More...
 
- Public Member Functions inherited from ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase
virtual void Start ()
 Starts this instance to collect and publish counter data. More...
 
virtual void Stop ()
 Stops this instance. More...
 
IDisposable SubscribeToChannel (Channel< CounterSampleMessage > channel)
 Subscribes the sender to a channel of CounterSampleMessages. More...
 
void IncrementErrorCount ()
 
void ResetErrorCount ()
 
void Dispose ()
 Disposes this instance. More...
 
void RaiseErrorEvent (Exception exception)
 Invokes the OnError event. More...
 
void RaiseOnDisconnetedEvent ()
 Invokes the OnDisconnected event. More...
 

Static Public Member Functions

static ICounterSampleWriter CreateWriter (CounterSampleSenderSettings s)
 

Additional Inherited Members

- Public Attributes inherited from ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase
const int DefaultInitialDelay = 10
 
const int DefaultSendInterval = 10
 
const int DefaultMaxRetryCount = -1
 
readonly string SenderId
 The local sender id. More...
 
readonly int InitialDelay = DefaultInitialDelay
 Time period to start publishing data since expired. More...
 
readonly int SendInterval = DefaultSendInterval
 The publish interval in seconds. More...
 
readonly int MaxRetryCount = DefaultMaxRetryCount
 Gets a value indicating how many error can occur during publishing before the counter publishers stops publishing. If a value equal or less than than zero is specified the counter publisher will never stop if an error occurred. The default value is -1; More...
 
readonly ICounterSampleWriter Writer
 The used ICounterSampleWriter to write data out. More...
 
readonly PoolFiber Fiber = new PoolFiber()
 The fiber for async sending. More...
 
- Static Public Attributes inherited from ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase
static readonly ILogger Log = LogManager.GetCurrentClassLogger()
 Provides a ILogger instance used to log messages into the logging framework. More...
 
- Protected Member Functions inherited from ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase
 CounterSampleSenderBase (string senderId, int initialDelay, int sendInterval, int maxRetryCount, ICounterSampleWriter writer)
 Initializes a new instance of the CounterSampleSender class. More...
 
virtual void Dispose (bool disposing)
 Stops the sender. More...
 
- Properties inherited from ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase
int ErrorCount [get]
 Gets the number of errors that occurred since the last successful publish. The counter publisher tries to publish the data again until the MaxRetryCount is reached. TODO: MT insecure More...
 
long State [get, set]
 0 = stopped, running > 0. More...
 
bool Running [get]
 
int SampleCount [get]
 The current sample count. TODO: MT insecure More...
 
- Events inherited from ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase
EventHandler< UnhandledExceptionEventArgs > OnError
 Fired when an unhandled Exception occurs during publishing. The instance stops publishing data if that happens. More...
 
EventHandler OnDisconnected
 Occurs when the underling ISocketSender is disconnected. More...
 

Detailed Description

Collects data from ICounter instances and publishes the data in a specified interval using an ISocketSender implementation.

Constructor & Destructor Documentation

ExitGames.Diagnostics.Monitoring.CounterSampleSender.CounterSampleSender ( string  senderId,
int  initialDelay,
int  sendInterval,
int  maxRetryCount,
ICounterSampleWriter  writer 
)
inline

Initializes a new instance of the CounterSampleSender class.

Parameters
senderIdThe sender id.
initialDelayThe publish after first seconds pass.
sendIntervalThe publish interval.

///

Parameters
maxRetryCountMax retry count of publishing data before full stop.
writerThe data writer.
ExitGames.Diagnostics.Monitoring.CounterSampleSender.CounterSampleSender ( CounterSampleSenderSettings  s)
inline

Initializes a new instance of the CounterSampleSender class.

Parameters
sThe configuration.

Member Function Documentation

static ICounterSampleWriter ExitGames.Diagnostics.Monitoring.CounterSampleSender.CreateWriter ( CounterSampleSenderSettings  s)
inlinestatic