Show / Hide Table of Contents

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
System.Object
OperationHolderAdapter<T>
DependencyOperationHolderAdapter
RequestOperationHolderAdapter
Implements
ITelemetryOperationHolder
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 Source

OperationHolderAdapter(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 Source

Operation

The adaptee object - the wrapped application insights operation itself

Declaration
protected readonly IOperationHolder<T> Operation
Field Value
Type Description
IOperationHolder<T>

Properties

View Source

Duration

Gets or sets the duration of the operation.

Declaration
public TimeSpan Duration { get; set; }
Property Value
Type Description
TimeSpan
View Source

Id

Gets or sets Operation ID.

Declaration
public string Id { get; set; }
Property Value
Type Description
System.String
View Source

Metrics

Gets the custom metrics collection.

Declaration
public IDictionary<string, double> Metrics { get; }
Property Value
Type Description
IDictionary<System.String, System.Double>
View Source

Name

Gets or sets the name of the operation.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
View Source

Properties

Gets the custom properties collection.

Declaration
public IDictionary<string, string> Properties { get; }
Property Value
Type Description
IDictionary<System.String, System.String>
View Source

Success

Gets or sets whether operation has finished successfully.

Declaration
public bool? Success { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>
View Source

Timestamp

Gets or sets the timestamp for the operation.

Declaration
public DateTimeOffset Timestamp { get; set; }
Property Value
Type Description
DateTimeOffset

Methods

View Source

SetFailed()

Sets the operation as failed.

Declaration
public virtual void SetFailed()
View Source

SetSuccess()

Sets the operation as successful success.

Declaration
public virtual void SetSuccess()
View Source

StopOperation()

Stop operation computes the duration of the operation and tracks it using the respective telemetry client.

Declaration
public virtual void StopOperation()

Implements

ITelemetryOperationHolder
  • View Source
Back to top Copyright © DNV GL AS. All rights reserved.