Documentation ¶
Overview ¶
Package metrics defines metrics utilities.
Index ¶
- type DurationWithLabel
- type DurationWithLabels
- func (ds DurationWithLabels) CSV(path string) error
- func (ds DurationWithLabels) Len() int
- func (ds DurationWithLabels) Less(i, j int) bool
- func (ds DurationWithLabels) PickLantencyP50() DurationWithLabel
- func (ds DurationWithLabels) PickLantencyP90() DurationWithLabel
- func (ds DurationWithLabels) PickLantencyP99() DurationWithLabel
- func (ds DurationWithLabels) PickLantencyP999() DurationWithLabel
- func (ds DurationWithLabels) PickLantencyP9999() DurationWithLabel
- func (ds DurationWithLabels) Swap(i, j int)
- type Durations
- func (ds Durations) Len() int
- func (ds Durations) Less(i, j int) bool
- func (ds Durations) PickLantencyP50() time.Duration
- func (ds Durations) PickLantencyP90() time.Duration
- func (ds Durations) PickLantencyP99() time.Duration
- func (ds Durations) PickLantencyP999() time.Duration
- func (ds Durations) PickLantencyP9999() time.Duration
- func (ds Durations) Swap(i, j int)
- type HistogramBucket
- type HistogramBuckets
- type RequestsCompare
- type RequestsSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DurationWithLabel ¶ added in v1.4.6
DurationWithLabel is the duration with label. ref. https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
type DurationWithLabels ¶ added in v1.4.6
type DurationWithLabels []DurationWithLabel
func LabelDurations ¶ added in v1.4.6
func LabelDurations(ds1 Durations, label string) (ds2 DurationWithLabels)
LabelDurations labels durations.
func (DurationWithLabels) CSV ¶ added in v1.4.6
func (ds DurationWithLabels) CSV(path string) error
func (DurationWithLabels) Len ¶ added in v1.4.6
func (ds DurationWithLabels) Len() int
func (DurationWithLabels) Less ¶ added in v1.4.6
func (ds DurationWithLabels) Less(i, j int) bool
func (DurationWithLabels) PickLantencyP50 ¶ added in v1.4.6
func (ds DurationWithLabels) PickLantencyP50() DurationWithLabel
PickLantencyP50 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickLantencyP90 ¶ added in v1.4.6
func (ds DurationWithLabels) PickLantencyP90() DurationWithLabel
PickLantencyP90 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickLantencyP99 ¶ added in v1.4.6
func (ds DurationWithLabels) PickLantencyP99() DurationWithLabel
PickLantencyP99 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickLantencyP999 ¶ added in v1.4.6
func (ds DurationWithLabels) PickLantencyP999() DurationWithLabel
PickLantencyP999 returns the latency assuming durations are already sorted.
func (DurationWithLabels) PickLantencyP9999 ¶ added in v1.4.6
func (ds DurationWithLabels) PickLantencyP9999() DurationWithLabel
PickLantencyP9999 returns the latency assuming durations are already sorted.
func (DurationWithLabels) Swap ¶ added in v1.4.6
func (ds DurationWithLabels) Swap(i, j int)
type Durations ¶ added in v1.2.7
func DownloadDurationsFromS3 ¶ added in v1.4.6
func DownloadDurationsFromS3(lg *zap.Logger, s3API s3iface.S3API, bucketName string, s3Key string) (rs Durations, err error)
DownloaDurationsRFromS3 downloads the file from S3 bucket, and parses "Durations".
func (Durations) PickLantencyP50 ¶ added in v1.2.7
PickLantencyP50 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP90 ¶ added in v1.2.7
PickLantencyP90 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP99 ¶ added in v1.2.7
PickLantencyP99 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP999 ¶ added in v1.2.7
PickLantencyP999 returns the latency assuming durations are already sorted.
func (Durations) PickLantencyP9999 ¶ added in v1.2.7
PickLantencyP9999 returns the latency assuming durations are already sorted.
type HistogramBucket ¶
type HistogramBucket struct { Scale string `json:"scale"` LowerBound float64 `json:"lower-bound"` UpperBound float64 `json:"upper-bound"` Count uint64 `json:"count"` }
HistogramBucket represents metrics latency bucket.
func (HistogramBucket) String ¶
func (bucket HistogramBucket) String() string
type HistogramBuckets ¶
type HistogramBuckets []HistogramBucket
func MergeHistograms ¶
func MergeHistograms(a HistogramBuckets, b HistogramBuckets) (HistogramBuckets, error)
MergeHistograms merges two histograms.
func ParseHistogram ¶
func ParseHistogram(scale string, histo *dto.Histogram) (buckets HistogramBuckets, err error)
ParseHistogram parses Prometheus histogram.
func (HistogramBuckets) Len ¶
func (buckets HistogramBuckets) Len() int
func (HistogramBuckets) Less ¶
func (buckets HistogramBuckets) Less(i, j int) bool
func (HistogramBuckets) Swap ¶
func (buckets HistogramBuckets) Swap(i, j int)
func (HistogramBuckets) Table ¶ added in v1.2.0
func (buckets HistogramBuckets) Table() string
Table converts "HistogramBuckets" to table.
type RequestsCompare ¶ added in v1.4.6
type RequestsCompare struct { A RequestsSummary `json:"a" read-only:"true"` B RequestsSummary `json:"b" read-only:"true"` LantencyP50DeltaPercent float64 `json:"latency-p50-delta-percent" read-only:"true"` LantencyP90DeltaPercent float64 `json:"latency-p90-delta-percent" read-only:"true"` LantencyP99DeltaPercent float64 `json:"latency-p99-delta-percent" read-only:"true"` LantencyP999DeltaPercent float64 `json:"latency-p99.9-delta-percent" read-only:"true"` LantencyP9999DeltaPercent float64 `json:"latency-p99.99-delta-percent" read-only:"true"` }
RequestsCompare compares two "RequestsSummary". Delta is computed with "A" as "before" and with "B" as "after".
func CompareRequestsSummary ¶ added in v1.4.6
func CompareRequestsSummary(a RequestsSummary, b RequestsSummary) (c RequestsCompare, err error)
CompareRequestsSummary compares two "RequestsSummary".
func (RequestsCompare) JSON ¶ added in v1.4.6
func (c RequestsCompare) JSON() string
func (RequestsCompare) Table ¶ added in v1.4.6
func (c RequestsCompare) Table() string
type RequestsSummary ¶ added in v1.2.2
type RequestsSummary struct { // TestID is the test ID. TestID string `json:"test-id" read-only:"true"` // SuccessTotal is the number of successful client requests. SuccessTotal float64 `json:"success-total" read-only:"true"` // FailureTotal is the number of failed client requests. FailureTotal float64 `json:"failure-total" read-only:"true"` // LatencyHistogram is the client requests latency histogram. LatencyHistogram HistogramBuckets `json:"latency-histogram" read-only:"true"` // LantencyP50 is the 50-percentile latency. LantencyP50 time.Duration `json:"latency-p50" read-only:"true"` // LantencyP90 is the 90-percentile latency. LantencyP90 time.Duration `json:"latency-p90" read-only:"true"` // LantencyP99 is the 99-percentile latency. LantencyP99 time.Duration `json:"latency-p99" read-only:"true"` // LantencyP999 is the 99.9-percentile latency. LantencyP999 time.Duration `json:"latency-p99.9" read-only:"true"` // LantencyP9999 is the 99.99-percentile latency. LantencyP9999 time.Duration `json:"latency-p99.99" read-only:"true"` }
RequestsSummary represents request results.
func DownloadRequestsSummaryFromS3 ¶ added in v1.4.6
func DownloadRequestsSummaryFromS3(lg *zap.Logger, s3API s3iface.S3API, bucketName string, s3Key string) (rs RequestsSummary, err error)
DownloadRequestsSummaryFromS3 downloads the file from S3 bucket, and parses "RequestsSummary".
func (RequestsSummary) JSON ¶ added in v1.2.2
func (rs RequestsSummary) JSON() string
func (RequestsSummary) Table ¶ added in v1.2.2
func (rs RequestsSummary) Table() string