Class OperationHolderAdapter<T>
Object adapter implementing ITelemetryOperationHolder but delegating to an Application Insight Microsoft.ApplicationInsights.Extensibility.IOperationHolder instance. Represents the operation item that holds telemetry which is tracked on end request. Operation can be associated with either WEB or SQL dependencies.
Inheritance
Implements
Namespace: DNVGL.One.Telemetry.Core.ApplicationInsights.Adapters
Assembly: DNVGL.One.Telemetry.Core.ApplicationInsights.dll
Syntax
public class OperationHolderAdapter<T> : object, ITelemetryOperationHolder where T : OperationTelemetry
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
View SourceOperationHolderAdapter(IOperationHolder<T>)
Initializes a new instance of the OperationHolderAdapter<T> class.
Declaration
public OperationHolderAdapter(IOperationHolder<T> operation)
Parameters
| Type | Name | Description |
|---|---|---|
| IOperationHolder<T> | operation | The adaptee object - an Application Insights operation holder |
Fields
View SourceOperation
The adaptee object - the wrapped application insights operation itself
Declaration
protected readonly IOperationHolder<T> Operation
Field Value
| Type | Description |
|---|---|
| IOperationHolder<T> |
Properties
View SourceDuration
Gets or sets the duration of the operation.
Declaration
public TimeSpan Duration { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Id
Gets or sets Operation ID.
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Metrics
Gets the custom metrics collection.
Declaration
public IDictionary<string, double> Metrics { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary<System.String, System.Double> |
Name
Gets or sets the name of the operation.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Properties
Gets the custom properties collection.
Declaration
public IDictionary<string, string> Properties { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary<System.String, System.String> |
Success
Gets or sets whether operation has finished successfully.
Declaration
public bool? Success { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
Timestamp
Gets or sets the timestamp for the operation.
Declaration
public DateTimeOffset Timestamp { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
Methods
View SourceSetFailed()
Sets the operation as failed.
Declaration
public virtual void SetFailed()
SetSuccess()
Sets the operation as successful success.
Declaration
public virtual void SetSuccess()
StopOperation()
Stop operation computes the duration of the operation and tracks it using the respective telemetry client.
Declaration
public virtual void StopOperation()