Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( APIRequestMetrics = &VContainerMetrics{ Duration: metrics.NewHistogramVec( &metrics.HistogramOpts{ Name: "vcontainer_api_request_duration_seconds", Help: "Latency of an vContainer API call", }, []string{"request"}), Total: metrics.NewCounterVec( &metrics.CounterOpts{ Name: "vcontainer_api_requests_total", Help: "Total number of vContainer API calls", }, []string{"request"}), Errors: metrics.NewCounterVec( &metrics.CounterOpts{ Name: "vcontainer_api_request_errors_total", Help: "Total number of errors for an vContainer API call", }, []string{"request"}), } )
Functions ¶
func InitializeRecorder ¶
func InitializeRecorder() *metricRecorder
InitializeRecorder initializes a new metricRecorder instance if it hasn't been initialized.
func Recorder ¶
func Recorder() *metricRecorder
Recorder returns the singleton instance of metricRecorder. nil is returned if the recorder is not initialized.
func RegisterMetrics ¶
func RegisterMetrics(component string)
Types ¶
type MetricContext ¶
type MetricContext struct { Start time.Time Attributes []string Metrics *VContainerMetrics }
MetricContext indicates the context for OpenStack metrics.
func NewMetricContext ¶
func NewMetricContext(resource string, request string) *MetricContext
NewMetricContext creates a new MetricContext.
func (*MetricContext) Observe ¶
func (s *MetricContext) Observe(om *VContainerMetrics, err error) error
Observe records the request latency and counts the errors.
func (*MetricContext) ObserveReconcile ¶
func (s *MetricContext) ObserveReconcile(err error) error
ObserveReconcile records the request reconciliation duration
func (*MetricContext) ObserveRequest ¶
func (s *MetricContext) ObserveRequest(err error) error
ObserveRequest records the request latency and counts the errors.
type VContainerMetrics ¶
type VContainerMetrics struct { Duration *metrics.HistogramVec Total *metrics.CounterVec Errors *metrics.CounterVec }
Click to show internal directories.
Click to hide internal directories.