Documentation

Overview

    Package metrics contains utilities for exporting metrics.

    Index

    Constants

    View Source
    const MetricRoot = "en-server/"

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Exporter

    type Exporter interface {
    	WriteBool(name string, value bool)
    	WriteInt(name string, cumulative bool, value int)
    	WriteInt64(name string, cumulative bool, value int64)
    	WriteIntDistribution(name string, cumulative bool, values []int)
    	WriteFloat64(name string, cumulative bool, value float64)
    	WriteFloat64Distribution(name string, cumulative bool, values []float64)
    }

      Exporter defines a generic metric exporter interface used in this application.

      func NewLogsBasedExporter

      func NewLogsBasedExporter(log *zap.SugaredLogger) Exporter

        NewLogsBasedExporter creates a new logs based importer from a logger.

        func NewLogsBasedFromContext

        func NewLogsBasedFromContext(ctx context.Context) Exporter

          NewLogsBasedFromContext creates a logs based metrics exporter.

          type ExporterFromContext

          type ExporterFromContext func(context.Context) Exporter

            ExporterFromContext defines a function to create a new exporter based on the current context.

            Directories

            Path Synopsis
            Package metricsware provides a middleware for recording metrics of different kinds
            Package metricsware provides a middleware for recording metrics of different kinds