Documentation
¶
Overview ¶
Package azuremonitor provides an in-memory mock implementation of Azure Monitor.
Index ¶
- type Mock
- func (m *Mock) CreateAlarm(_ context.Context, cfg driver.AlarmConfig) error
- func (m *Mock) DeleteAlarm(_ context.Context, name string) error
- func (m *Mock) DescribeAlarms(_ context.Context, names []string) ([]driver.AlarmInfo, error)
- func (m *Mock) GetMetricData(_ context.Context, input driver.GetMetricInput) (*driver.MetricDataResult, error)
- func (m *Mock) ListMetrics(_ context.Context, namespace string) ([]string, error)
- func (m *Mock) PutMetricData(_ context.Context, data []driver.MetricDatum) error
- func (m *Mock) SetAlarmState(_ context.Context, name, state, reason string) error
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 (*Mock) CreateAlarm ¶
CreateAlarm creates or updates a metric alert rule with the given configuration.
func (*Mock) DeleteAlarm ¶
DeleteAlarm deletes the metric alert rule with the given name.
func (*Mock) DescribeAlarms ¶
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 ¶
ListMetrics returns unique metric names for the given namespace.
func (*Mock) PutMetricData ¶
PutMetricData stores metric data points and evaluates any matching alarms.