azuremonitor

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package azuremonitor provides an in-memory mock implementation of Azure Monitor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is an in-memory mock implementation of the Azure Monitor service.

func New

func New(opts *config.Options) *Mock

New creates a new Azure Monitor mock with the given configuration options.

func (*Mock) CreateAlarm

func (m *Mock) CreateAlarm(_ context.Context, cfg driver.AlarmConfig) error

CreateAlarm creates or updates a metric alert rule with the given configuration.

func (*Mock) DeleteAlarm

func (m *Mock) DeleteAlarm(_ context.Context, name string) error

DeleteAlarm deletes the metric alert rule with the given name.

func (*Mock) DescribeAlarms

func (m *Mock) DescribeAlarms(_ context.Context, names []string) ([]driver.AlarmInfo, error)

DescribeAlarms returns alarms matching the given names, or all alarms if names is empty.

func (*Mock) GetMetricData

func (m *Mock) GetMetricData(_ context.Context, input driver.GetMetricInput) (*driver.MetricDataResult, error)

GetMetricData retrieves metric data for the given query, filtering by time range and computing the requested statistic.

func (*Mock) ListMetrics

func (m *Mock) ListMetrics(_ context.Context, namespace string) ([]string, error)

ListMetrics returns unique metric names for the given namespace.

func (*Mock) PutMetricData

func (m *Mock) PutMetricData(_ context.Context, data []driver.MetricDatum) error

PutMetricData stores metric data points and evaluates any matching alarms.

func (*Mock) SetAlarmState

func (m *Mock) SetAlarmState(_ context.Context, name, state, reason string) error

SetAlarmState manually sets the state of a metric alert rule.

Jump to

Keyboard shortcuts

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