clair: github.com/coreos/clair/database/pgsql/monitoring Index | Files

package monitoring

import "github.com/coreos/clair/database/pgsql/monitoring"

Index

Package Files

prometheus.go

Variables

var (
    PromErrorsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
        Name: "clair_pgsql_errors_total",
        Help: "Number of errors that PostgreSQL requests generated.",
    }, []string{"request"})

    PromCacheHitsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
        Name: "clair_pgsql_cache_hits_total",
        Help: "Number of cache hits that the PostgreSQL backend did.",
    }, []string{"object"})

    PromCacheQueriesTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
        Name: "clair_pgsql_cache_queries_total",
        Help: "Number of cache queries that the PostgreSQL backend did.",
    }, []string{"object"})

    PromQueryDurationMilliseconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{
        Name: "clair_pgsql_query_duration_milliseconds",
        Help: "Time it takes to execute the database query.",
    }, []string{"query", "subquery"})

    PromConcurrentLockVAFV = prometheus.NewGauge(prometheus.GaugeOpts{
        Name: "clair_pgsql_concurrent_lock_vafv_total",
        Help: "Number of transactions trying to hold the exclusive Vulnerability_Affects_Feature lock.",
    })
)

func ObserveQueryTime Uses

func ObserveQueryTime(query, subquery string, start time.Time)

monitoring.ObserveQueryTime computes the time elapsed since `start` to represent the query time. 1. `query` is a pgSession function name. 2. `subquery` is a specific query or a batched query. 3. `start` is the time right before query is executed.

Package monitoring imports 2 packages (graph) and is imported by 8 packages. Updated 2019-03-27. Refresh now. Tools for package owners.