testutils

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testutils provides utilities for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventMetricsByTargetMetric added in v0.13.4

func EventMetricsByTargetMetric(ems []*metrics.EventMetrics) map[string]map[string][]*metrics.EventMetrics

func LabelsMapByTarget added in v0.12.7

func LabelsMapByTarget(ems []*metrics.EventMetrics) map[string]map[string]string

func MetricsFromChannel

func MetricsFromChannel(dataChan chan *metrics.EventMetrics, num int, timeout time.Duration) (results []*metrics.EventMetrics, err error)

MetricsFromChannel reads metrics.EventMetrics from dataChannel with a timeout

Types

type MetricsMap

type MetricsMap map[string]map[string][]metrics.Value

func MetricsMapByTarget added in v0.12.7

func MetricsMapByTarget(ems []*metrics.EventMetrics) MetricsMap

MetricsMapByTarget rearranges a list of metrics into a map of map.

{
  "target1": {
      "m1": [val1, val2..],
      "m2": [val1],
  },
  "target2": {
      ...
  }
}

func (MetricsMap) Filter added in v0.12.7

func (mmap MetricsMap) Filter(metricName string) map[string][]metrics.Value

Filter returns a map of target to values for a given metric name.

func (MetricsMap) LastValueInt64 added in v0.12.7

func (mmap MetricsMap) LastValueInt64(target, metricName string) int64

LastValueInt64 returns the last value for a given metric name and target.

Jump to

Keyboard shortcuts

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