InstrumentTiming

Creates logs, counters and timings for methods that call Instrument.

Description

The InstrumentTiming class allows you to create logs, countes and timings for methods that call Instrument.

Constructors

NewInstrumentTiming

Creates a new instance of InstrumentTiming.

NewInstrumentTiming(correlationId string, name string, verb string, logger ILogger, counters ICounters, counterTiming CounterTiming, traceTiming TraceTiming) *InstrumentTiming

  • correlationId: string - transaction id used to trace execution through the call chain.
  • name: string - name
  • verb: string - verb or ‘call’
  • logger: ILogger - logger
  • counters: ICounters - counters
  • counterTiming: CounterTiming - counter
  • traceTiming: TraceTiming - time tracer

Methods

EndFailure

Manages a failed service end.

(c *InstrumentTiming) EndFailure(ctx context.Context, err error)

  • ctx: context.Context - operation context.
  • err: error - exception

EndTiming

Ends the service.

(c *InstrumentTiming) EndTiming(ctx context.Context, err error)

  • ctx: context.Context - operation context.
  • err: error - exception

EndSuccess

Manages a successful service end.

(c *InstrumentTiming) EndSuccess(ctx context.Context)

  • ctx: context.Context - operation context.