query

package
v2.1.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package query provdes query metrics with this file providing aggregared metrics based on the underlying values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedQueryMetrics

type AggregatedQueryMetrics struct {
	// fill me in here
	Count                int
	MaxLatencySeconds    float64
	MeanLatencySeconds   float64
	MedianLatencySeconds float64
	P95LatencySeconds    float64
	MaxWaitSeconds       float64
	MeanWaitSeconds      float64
	MedianWaitSeconds    float64
	P95WaitSeconds       float64
}

func AggregatedSince

func AggregatedSince(c *collection.Collection, t time.Time) AggregatedQueryMetrics

AggregatedSince returns the aggregated query metrics for the period given from the values provided.

type Metric

type Metric struct {
	Timestamp      time.Time     // time the metric was started
	WaitLatency    time.Duration // time that we had to wait before starting query execution
	ExecuteLatency time.Duration // time the query took to execute
	Err            error         // any error resulting from the query execution
}

Metric records query metrics of backend writes that go through a sized channel. It allows us to compare the time waiting to execute the query against the time needed to run it and in a "sized channel" the wait time may be significant and is good to measure.

func NewMetric

func NewMetric() *Metric

NewMetric returns a new metric with timestamp starting from now

func (Metric) When

func (m Metric) When() time.Time

When records the timestamp of the start of the recording

Jump to

Keyboard shortcuts

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