Show / Hide Table of Contents

Class InstrumentationService

Implements IInstrumentation. This service aggregates data by type,source and sends result into provider

Inheritance
System.Object
DisposableObject
ApplicationComponent
Service
Service<System.Object>
ServiceWithInstrumentationBase<System.Object>
InstrumentationService
Implements
IService
INamed
IInstrumentationImplementation
IInstrumentation
IApplicationComponent
ILocalizedTimeProvider
System.IDisposable
IConfigurable
IInstrumentable
IExternallyParameterized
Inherited Members
ServiceWithInstrumentationBase<Object>.ExternalParameters
ServiceWithInstrumentationBase<Object>.ExternalParametersForGroups(String[])
ServiceWithInstrumentationBase<Object>.ExternalGetParameter(String, Object, String[])
ServiceWithInstrumentationBase<Object>.ExternalSetParameter(String, Object, String[])
Service<Object>.ComponentDirector
Service.CONFIG_NAME_ATTR
Service.Destructor()
Service.ApplicationDontAutoStartService
Service.Status
Service.Running
Service.Name
Service.TimeLocation
Service.LocalizedTime
Service.Configure(IConfigSectionNode)
Service.Start()
Service.SignalStop()
Service.CheckForCompleteStop()
Service.WaitForCompleteStop()
Service.AcceptManagerVisit(Object, DateTime)
Service.UniversalTimeToLocalizedTime(DateTime)
Service.LocalizedTimeToUniversalTime(DateTime)
Service.AbortStart()
Service.DoCheckForCompleteStop()
Service.CheckServiceInactive()
Service.CheckServiceActive()
Service.CheckServiceActiveOrStarting()
Service.DoAcceptManagerVisit(Object, DateTime)
Service.____ObtainPrivateServiceStatusLockObject()
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
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()
Namespace: NFX.Instrumentation
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
ApplicationComponent.ComponentCommonName

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
Type Description
MessageType

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
Type Description
InstrumentationProvider

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

DoConfigure(IConfigSectionNode)

Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Overrides
Service.DoConfigure(IConfigSectionNode)

DoSignalStop()

Declaration
protected override void DoSignalStop()
Overrides
Service.DoSignalStop()

DoStart()

Declaration
protected override void DoStart()
Overrides
Service.DoStart()

DoWaitForCompleteStop()

Declaration
protected override void DoWaitForCompleteStop()
Overrides
Service.DoWaitForCompleteStop()

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

IService
INamed
IInstrumentationImplementation
IInstrumentation
IApplicationComponent
ILocalizedTimeProvider
System.IDisposable
IConfigurable
IInstrumentable
IExternallyParameterized

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX