package
0.0.3
Repository: https://github.com/bhojpur/knative-pkg.git
Documentation: pkg.go.dev

# Functions

AssertMetric verifies that the metrics have the specified values.
AssertMetricExists verifies that at least one metric values has been reported for each of metric names.
AssertNoMetric verifies that no metrics have been reported for any of the metric names.
CheckCountData checks the view with a name matching string name to verify that the CountData stats reported are tagged with the tags in wantTags and that wantValue matches reported count.
CheckDistributionCount checks the view with a name matching string name to verify that the DistributionData stats reported are tagged with the tags in wantTags and that expectedCount number of records were reported.
CheckDistributionData checks the view with a name matching string name to verify that the DistributionData stats reported are tagged with the tags in wantTags and that expectedCount number of records were reported.
CheckLastValueData checks the view with a name matching string name to verify that the LastValueData stats reported are tagged with the tags in wantTags and that wantValue matches reported last value.
CheckLastValueDataWithMeter checks the view with a name matching the string name in the specified Meter (resource-specific view) to verify that the LastValueData stats are tagged with the tags in wantTags and that wantValue matches the last reported value.
CheckStatsNotReported checks that there are no records for any views that a name matching a string in names.
CheckStatsReported checks that there is a view registered with the given name for each string in names, and that each view has at least one record.
CheckSumData checks the view with a name matching string name to verify that the SumData stats reported are tagged with the tags in wantTags and that wantValue matches the reported sum.
DistributionCountOnlyMetric creates a distribution metric for test, and verifying only the count.
EnsureRecorded makes sure that all stats metrics are actually flushed and recorded.
FloatMetric creates a Float64 metric.
GetLastValueData returns the last value for the given metric, verifying tags.
GetLastValueDataWithMeter returns the last value of the given metric using meter, verifying tags.
GetMetric returns all values for the named metric.
GetOneMetric is like GetMetric, but it panics if more than a single Metric is found.
IntMetric creates an Int64 metric.
NewMetric creates a Metric from a metricdata.Metric, which is designed for compact wire representation.
Unregister unregisters the metrics that were registered.

# Structs

Metric provides a simplified (for testing) implementation of a metric report for a given metric name in a given Resource.
Value provides a simplified implementation of a metric Value suitable for easy testing.