Documentation ¶
Index ¶
- Variables
- func On(ctx context.Context) bool
- func WithClient(ctx context.Context, client Client) context.Context
- type Client
- type Counter
- func GetAllocsCompletedCountCounter(ctx context.Context) Counter
- func GetAllocsCompletedSizeCounter(ctx context.Context) Counter
- func GetAllocsStartedCountCounter(ctx context.Context) Counter
- func GetAllocsStartedSizeCounter(ctx context.Context) Counter
- func GetTasksCompletedCountCounter(ctx context.Context) Counter
- func GetTasksCompletedSizeCounter(ctx context.Context) Counter
- func GetTasksStartedCountCounter(ctx context.Context) Counter
- func GetTasksStartedSizeCounter(ctx context.Context) Counter
- func GetTasksSubmittedCountCounter(ctx context.Context) Counter
- func GetTasksSubmittedSizeCounter(ctx context.Context) Counter
- type Gauge
- func GetAllocsLiveResourcesGauge(ctx context.Context, resource string) Gauge
- func GetAllocsLiveSizeGauge(ctx context.Context) Gauge
- func GetMemstatsHeapInuseBytesGauge(ctx context.Context) Gauge
- func GetMemstatsHeapObjectsGauge(ctx context.Context) Gauge
- func GetMemstatsHeapSysBytesGauge(ctx context.Context) Gauge
- func GetMemstatsStackInuseBytesGauge(ctx context.Context) Gauge
- func GetMemstatsStackSysBytesGauge(ctx context.Context) Gauge
- func GetPoolAvailResourcesGauge(ctx context.Context, resource string) Gauge
- func GetPoolAvailSizeGauge(ctx context.Context) Gauge
- func GetPoolTotalResourcesGauge(ctx context.Context, resource string) Gauge
- func GetPoolTotalSizeGauge(ctx context.Context) Gauge
- func GetTasksInProgressResourcesGauge(ctx context.Context, resource string) Gauge
- func GetTasksInProgressSizeGauge(ctx context.Context) Gauge
- type Histogram
Constants ¶
This section is empty.
Variables ¶
var ( Counters = map[string]counterOpts{ "allocs_completed_count": { Help: "Count of completed allocs.", }, "allocs_completed_size": { Help: "Size of completed allocs.", }, "allocs_started_count": { Help: "Count of started allocs.", }, "allocs_started_size": { Help: "Size of started allocs.", }, "tasks_completed_count": { Help: "Count of completed tasks.", }, "tasks_completed_size": { Help: "Size of completed tasks.", }, "tasks_started_count": { Help: "Count of started tasks.", }, "tasks_started_size": { Help: "Size of started tasks.", }, "tasks_submitted_count": { Help: "Count of submitted tasks.", }, "tasks_submitted_size": { Help: "Size of submitted tasks.", }, } Gauges = map[string]gaugeOpts{ "allocs_live_resources": { Help: "Resources of live allocs.", Labels: []string{"resource"}, }, "allocs_live_size": { Help: "Size of live allocs.", }, "memstats_heap_inuse_bytes": { Help: "Bytes of memory used by in use heap spans.", }, "memstats_heap_objects": { Help: "Current number of allocated heap objects.", }, "memstats_heap_sys_bytes": { Help: "Bytes of heap memory obtained from the OS.", }, "memstats_stack_inuse_bytes": { Help: "Bytes of memory used for stack spans.", }, "memstats_stack_sys_bytes": { Help: "Bytes of stack memory obtained from the OS.", }, "pool_avail_resources": { Help: "Available resources in a pool.", Labels: []string{"resource"}, }, "pool_avail_size": { Help: "Available size in a pool.", }, "pool_total_resources": { Help: "Total resources in a pool.", Labels: []string{"resource"}, }, "pool_total_size": { Help: "Total size of a pool.", }, "tasks_in_progress_resources": { Help: "Resources of tasks currently being processed.", Labels: []string{"resource"}, }, "tasks_in_progress_size": { Help: "Size of tasks currently being processed.", }, } Histograms = map[string]histogramOpts{ "dydbassoc_op_latency_seconds": { Help: "Dydbassoc operation latency in seconds.", Labels: []string{"operation"}, Buckets: []float64{0.001, 0.01, 0.1, 1, 10}, }, } )
Functions ¶
Types ¶
type Client ¶
type Client interface { GetGauge(name string, labels map[string]string) Gauge GetCounter(name string, labels map[string]string) Counter GetHistogram(name string, labels map[string]string) Histogram }
Client is a sink for metrics.
var NopClient Client = &nopClient{}
NopClient is default metrics client that does nothing.
type Counter ¶
type Counter interface { // Inc adds one to the counter Inc() // Add adds the given value to the counter. It panics if the value is < // 0. Add(float64) }
Counter wraps prometheus.Counter. Counters can only increase in value.
func GetAllocsCompletedCountCounter ¶
GetAllocsCompletedCountCounter returns a Counter to set metric allocs_completed_count (count of completed allocs).
func GetAllocsCompletedSizeCounter ¶
GetAllocsCompletedSizeCounter returns a Counter to set metric allocs_completed_size (size of completed allocs).
func GetAllocsStartedCountCounter ¶
GetAllocsStartedCountCounter returns a Counter to set metric allocs_started_count (count of started allocs).
func GetAllocsStartedSizeCounter ¶
GetAllocsStartedSizeCounter returns a Counter to set metric allocs_started_size (size of started allocs).
func GetTasksCompletedCountCounter ¶
GetTasksCompletedCountCounter returns a Counter to set metric tasks_completed_count (count of completed tasks).
func GetTasksCompletedSizeCounter ¶
GetTasksCompletedSizeCounter returns a Counter to set metric tasks_completed_size (size of completed tasks).
func GetTasksStartedCountCounter ¶
GetTasksStartedCountCounter returns a Counter to set metric tasks_started_count (count of started tasks).
func GetTasksStartedSizeCounter ¶
GetTasksStartedSizeCounter returns a Counter to set metric tasks_started_size (size of started tasks).
func GetTasksSubmittedCountCounter ¶
GetTasksSubmittedCountCounter returns a Counter to set metric tasks_submitted_count (count of submitted tasks).
func GetTasksSubmittedSizeCounter ¶
GetTasksSubmittedSizeCounter returns a Counter to set metric tasks_submitted_size (size of submitted tasks).
type Gauge ¶
type Gauge interface { // Set updates the value of the gauge Set(float64) // Inc increments the Gauge by 1. Use Add to increment it by arbitrary // values. Inc() // Dec decrements the Gauge by 1. Use Sub to decrement it by arbitrary // values. Dec() // Add adds the given value to the Gauge. (The value can be negative, // resulting in a decrease of the Gauge.) Add(float64) // Sub subtracts the given value from the Gauge. (The value can be // negative, resulting in an increase of the Gauge.) Sub(float64) }
Gauge wraps prometheus.Gauge. Gauges can be set to arbitrary values.
func GetAllocsLiveResourcesGauge ¶
GetAllocsLiveResourcesGauge returns a Gauge to set metric allocs_live_resources (resources of live allocs).
func GetAllocsLiveSizeGauge ¶
GetAllocsLiveSizeGauge returns a Gauge to set metric allocs_live_size (size of live allocs).
func GetMemstatsHeapInuseBytesGauge ¶
GetMemstatsHeapInuseBytesGauge returns a Gauge to set metric memstats_heap_inuse_bytes (bytes of memory used by in use heap spans).
func GetMemstatsHeapObjectsGauge ¶
GetMemstatsHeapObjectsGauge returns a Gauge to set metric memstats_heap_objects (current number of allocated heap objects).
func GetMemstatsHeapSysBytesGauge ¶
GetMemstatsHeapSysBytesGauge returns a Gauge to set metric memstats_heap_sys_bytes (bytes of heap memory obtained from the OS).
func GetMemstatsStackInuseBytesGauge ¶
GetMemstatsStackInuseBytesGauge returns a Gauge to set metric memstats_stack_inuse_bytes (bytes of memory used for stack spans).
func GetMemstatsStackSysBytesGauge ¶
GetMemstatsStackSysBytesGauge returns a Gauge to set metric memstats_stack_sys_bytes (bytes of stack memory obtained from the OS).
func GetPoolAvailResourcesGauge ¶
GetPoolAvailResourcesGauge returns a Gauge to set metric pool_avail_resources (available resources in a pool).
func GetPoolAvailSizeGauge ¶
GetPoolAvailSizeGauge returns a Gauge to set metric pool_avail_size (available size in a pool).
func GetPoolTotalResourcesGauge ¶
GetPoolTotalResourcesGauge returns a Gauge to set metric pool_total_resources (total resources in a pool).
func GetPoolTotalSizeGauge ¶
GetPoolTotalSizeGauge returns a Gauge to set metric pool_total_size (total size of a pool).
func GetTasksInProgressResourcesGauge ¶
GetTasksInProgressResourcesGauge returns a Gauge to set metric tasks_in_progress_resources (resources of tasks currently being processed).
func GetTasksInProgressSizeGauge ¶
GetTasksInProgressSizeGauge returns a Gauge to set metric tasks_in_progress_size (size of tasks currently being processed).