metrics

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Metric is the global metrics object
	Metric = &Metrics{
		Disable: true,
	}
)

Functions

func InitializeMetrics

func InitializeMetrics(metric string) error

InitializeMetrics - creates a new instance of a Metrics based on the type of metrics specified.

Types

type Metrics

type Metrics struct {
	Disable bool
	// contains filtered or unexported fields
}

Metrics - structure to keep information relevant to the metrics calculation Disable - disables metric calculations

func (*Metrics) Start

func (m *Metrics) Start(location string)

Start - starts gathering metrics for the location specified. A profile is only started for the outermost region; nested Start calls are counted so the matching Stop calls stay balanced but do not start a second profile.

func (*Metrics) Stop

func (m *Metrics) Stop()

Stop - stops gathering metrics and logs the result. Only the Stop that closes the outermost region finalizes the profile.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL