Class InstrumentationService
Implements IInstrumentation. This service aggregates data by type,source and sends result into provider
Inheritance
System.Object
InstrumentationService
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.dll
Syntax
[ConfigMacroContext]
public sealed class InstrumentationService : ServiceWithInstrumentationBase<object>, IService, INamed, IInstrumentationImplementation, IInstrumentation, IApplicationComponent, ILocalizedTimeProvider, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized
Constructors
InstrumentationService()
Creates a instrumentation service instance
Declaration
public InstrumentationService()
InstrumentationService(Object)
Creates a instrumentation service instance
Declaration
public InstrumentationService(object director)
Parameters
| Type |
Name |
Description |
| System.Object |
director |
|
Fields
CONFIG_PROVIDER_SECTION
Declaration
public const string CONFIG_PROVIDER_SECTION = "provider"
Field Value
| Type |
Description |
| System.String |
|
DEFAULT_MAX_REC_COUNT
Declaration
public const int DEFAULT_MAX_REC_COUNT = 1048576
Field Value
| Type |
Description |
| System.Int32 |
|
DEFAULT_RESULT_BUFFER_SIZE
Declaration
public const int DEFAULT_RESULT_BUFFER_SIZE = 131072
Field Value
| Type |
Description |
| System.Int32 |
|
MAX_RESULT_BUFFER_SIZE
Declaration
public const int MAX_RESULT_BUFFER_SIZE = 2097152
Field Value
| Type |
Description |
| System.Int32 |
|
MAXIMUM_MAX_REC_COUNT
Declaration
public const int MAXIMUM_MAX_REC_COUNT = 268435456
Field Value
| Type |
Description |
| System.Int32 |
|
MINIMUM_MAX_REC_COUNT
Declaration
public const int MINIMUM_MAX_REC_COUNT = 1024
Field Value
| Type |
Description |
| System.Int32 |
|
Properties
ComponentCommonName
Declaration
public override string ComponentCommonName { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
DataTypes
Enumerates distinct types of Datum ever recorded in the instance. This property may be used to build
UIs for instrumentation, i.e. datum type tree. Returned data is NOT ORDERED
Declaration
public IEnumerable<Type> DataTypes { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.Type> |
|
Enabled
Declaration
public bool Enabled { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
InstrumentationEnabled
Shortcut to SelfInstrumented, implements IInstrumentable
Declaration
[Config(Default = false)]
[ExternalParameter]
public override bool InstrumentationEnabled { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.InstrumentationEnabled
LogLevel
Declaration
[Config(Default = MessageType.Warning)]
[ExternalParameter]
public MessageType LogLevel { get; set; }
Property Value
MaxRecordCount
Gets/Sets the maximum record count that this instance can store
Declaration
[Config(null, 1048576)]
[ExternalParameter]
public int MaxRecordCount { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
OSInstrumentationIntervalMS
Specifies how often OS instrumentation such as CPU and RAM is sampled.
Value of zero disables OS sampling
Declaration
[Config("$os-interval-ms|$os-instrumentation-interval-ms")]
[ExternalParameter]
public int OSInstrumentationIntervalMS { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Overflown
Returns true to indicate that instrumentation does not have any space left to record more data
Declaration
public bool Overflown { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
ProcessingIntervalMS
Specifies how often aggregation is performed
Declaration
[Config("$processing-interval-ms|$interval-ms", 7000)]
[ExternalParameter]
public int ProcessingIntervalMS { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
Provider
References provider that persists instrumentation data
Declaration
public InstrumentationProvider Provider { get; set; }
Property Value
RecordCount
Returns current record count in the instance
Declaration
public int RecordCount { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
ResultBufferSize
Returns the size of the ring buffer where result (aggregated) instrumentation records are kept in memory.
The maximum buffer capacity is returned, not how many results have been buffered so far.
If this property is less than or equal to zero then result buffering in memory is disabled.
This property can be set only on a stopped service
Declaration
[Config(null, 131072)]
public int ResultBufferSize { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
SelfInstrumented
When true, outputs instrumentation data about the self (how many datum buffers, etc.)
Declaration
[Config("$self-instrumented|$instrument-self|$instrumented", false)]
public bool SelfInstrumented { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Methods
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Overrides
DoSignalStop()
Declaration
protected override void DoSignalStop()
Overrides
DoStart()
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
GetBufferedResults(Int32)
Returns the specified number of samples from the ring result buffer in the near-chronological order,
meaning that data is already sorted by time MOST of the TIME, however sorting is NOT GUARANTEED for all
result records returned as enumeration is a lazy procedure that does not make copies/take locks.
The enumeration is empty if ResultBufferSize is less or equal to zero entries.
If count is less or equal to zero then the system returns all results available.
Declaration
public IEnumerable<Datum> GetBufferedResults(int count = 0)
Parameters
| Type |
Name |
Description |
| System.Int32 |
count |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<Datum> |
|
GetBufferedResultsSince(DateTime)
Returns samples starting around the the specified UTCdate in the near-chronological order,
meaning that data is already sorted by time MOST of the TIME, however sorting is NOT GUARANTEED for all
result records returned as enumeration is a lazy procedure that does not make copies/take locks.
The enumeration is empty if ResultBufferSize is less or equal to zero entries
Declaration
public IEnumerable<Datum> GetBufferedResultsSince(DateTime utcStart)
Parameters
| Type |
Name |
Description |
| System.DateTime |
utcStart |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<Datum> |
|
GetDatumTypeSources(Type, out Datum)
Enumerates sources per Datum type ever recorded by the instance. This property may be used to build
UIs for instrumentation, i.e. datum type tree. Returned data is NOT ORDERED
Declaration
public IEnumerable<string> GetDatumTypeSources(Type datumType, out Datum defaultInstance)
Parameters
| Type |
Name |
Description |
| System.Type |
datumType |
|
| Datum |
defaultInstance |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<System.String> |
|
Log(MessageType, String, String, Exception, Nullable<Guid>, String)
Declaration
public Guid Log(MessageType type, string from, string message, Exception error = null, Guid? relatedMessageID = default (Guid? ), string parameters = null)
Parameters
| Type |
Name |
Description |
| MessageType |
type |
|
| System.String |
from |
|
| System.String |
message |
|
| System.Exception |
error |
|
| System.Nullable<System.Guid> |
relatedMessageID |
|
| System.String |
parameters |
|
Returns
| Type |
Description |
| System.Guid |
|
Record(Datum)
Records instrumentation datum
Declaration
public void Record(Datum datum)
Parameters
| Type |
Name |
Description |
| Datum |
datum |
|
Implements
System.IDisposable
Extension Methods