Documentation ¶
Index ¶
- type Config
- type CountMap
- type EmulatedMetricer
- func (n *EmulatedMetricer) Document() []metrics.DocumentedMetric
- func (n *EmulatedMetricer) RecordInfo(_ string)
- func (n *EmulatedMetricer) RecordRPCServerRequest(method string) func(status, mode, ver string)
- func (n *EmulatedMetricer) RecordSecondaryRequest(x string, y string) func(status string)
- func (n *EmulatedMetricer) RecordUp()
- type Metricer
- type Metrics
- func (m *Metrics) Document() []metrics.DocumentedMetric
- func (m *Metrics) RecordInfo(version string)
- func (m *Metrics) RecordRPCServerRequest(method string) func(status, mode, ver string)
- func (m *Metrics) RecordSecondaryRequest(bt string, method string) func(status string)
- func (m *Metrics) RecordUp()
- func (m *Metrics) StartServer(hostname string, port int) (*ophttp.HTTPServer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountMap ¶ added in v1.6.0
type CountMap struct {
// contains filtered or unexported fields
}
CountMap ... In memory representation of a prometheus Count metric type
type EmulatedMetricer ¶ added in v1.6.0
type EmulatedMetricer struct { HTTPServerRequestsTotal *CountMap // secondary metrics SecondaryRequestsTotal *CountMap }
EmulatedMetricer ... allows for tracking count metrics in memory and is only used for E2E testing. This is needed since prometheus/client_golang doesn't provide an interface for reading the count values from the codified metric.
func NewEmulatedMetricer ¶ added in v1.6.0
func NewEmulatedMetricer() *EmulatedMetricer
NewEmulatedMetricer ... constructor
func (*EmulatedMetricer) Document ¶ added in v1.6.0
func (n *EmulatedMetricer) Document() []metrics.DocumentedMetric
Document ... noop
func (*EmulatedMetricer) RecordInfo ¶ added in v1.6.0
func (n *EmulatedMetricer) RecordInfo(_ string)
RecordInfo ... noop
func (*EmulatedMetricer) RecordRPCServerRequest ¶ added in v1.6.0
func (n *EmulatedMetricer) RecordRPCServerRequest(method string) func(status, mode, ver string)
RecordRPCServerRequest ... updates server requests counter associated with label fingerprint
func (*EmulatedMetricer) RecordSecondaryRequest ¶ added in v1.6.0
func (n *EmulatedMetricer) RecordSecondaryRequest(x string, y string) func(status string)
RecordSecondaryRequest ... updates secondary insertion counter associated with label fingerprint
func (*EmulatedMetricer) RecordUp ¶ added in v1.6.0
func (n *EmulatedMetricer) RecordUp()
RecordUp ... noop
type Metricer ¶
type Metricer interface { RecordInfo(version string) RecordUp() RecordRPCServerRequest(method string) func(status string, mode string, ver string) RecordSecondaryRequest(bt string, method string) func(status string) Document() []metrics.DocumentedMetric }
Metricer ... Interface for metrics
type Metrics ¶
type Metrics struct { Info *prometheus.GaugeVec Up prometheus.Gauge // server metrics HTTPServerRequestsTotal *prometheus.CounterVec HTTPServerBadRequestHeader *prometheus.CounterVec HTTPServerRequestDurationSeconds *prometheus.HistogramVec // secondary metrics SecondaryRequestsTotal *prometheus.CounterVec SecondaryRequestDurationSec *prometheus.HistogramVec // contains filtered or unexported fields }
Metrics ... Metrics struct
func NewMetrics ¶
func (*Metrics) Document ¶
func (m *Metrics) Document() []metrics.DocumentedMetric
func (*Metrics) RecordInfo ¶
RecordInfo sets a pseudo-metric that contains versioning and config info for the proxy DA node.
func (*Metrics) RecordRPCServerRequest ¶ added in v1.4.1
RecordRPCServerRequest is a helper method to record an incoming HTTP request. It bumps the requests metric, and tracks how long it takes to serve a response, including the HTTP status code.
func (*Metrics) RecordSecondaryRequest ¶ added in v1.6.0
RecordSecondaryPut records a secondary put/get operation.
func (*Metrics) StartServer ¶
StartServer starts the metrics server on the given hostname and port. If port is 0, it automatically assigns an available port and returns the actual port.