Documentation
¶
Overview ¶
Package metrics provides Prometheus-compatible metrics for Subflux. Exposes counters and summaries for searches, downloads, and provider health.
Index ¶
- Variables
- type Metrics
- func (m *Metrics) AdaptiveSkip()
- func (m *Metrics) Handler() http.HandlerFunc
- func (m *Metrics) RecordDownload(provider api.ProviderID, err error)
- func (m *Metrics) RecordImport(source api.PollKey)
- func (m *Metrics) RecordScan(items, found int, dur time.Duration)
- func (m *Metrics) RecordSearch(provider api.ProviderID, dur time.Duration, err error)
- func (m *Metrics) TotalSearches() int64
Constants ¶
This section is empty.
Variables ¶
var BucketBounds = [8]float64{0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0, 30.0}
BucketBounds are the histogram boundaries in seconds. Tuned for the observed range of provider search durations (cache hits ~50-200ms, normal queries 0.5-2s, slow API calls 2-10s, near-timeout 10-30s).
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics holds all application metrics.
func (*Metrics) AdaptiveSkip ¶
func (m *Metrics) AdaptiveSkip()
AdaptiveSkip records an item skipped by adaptive search.
func (*Metrics) Handler ¶
func (m *Metrics) Handler() http.HandlerFunc
Handler returns an HTTP handler that serves Prometheus metrics.
func (*Metrics) RecordDownload ¶
func (m *Metrics) RecordDownload(provider api.ProviderID, err error)
RecordDownload records a download attempt, routing to the success or error counter.
func (*Metrics) RecordImport ¶
RecordImport records an import detected.
func (*Metrics) RecordScan ¶
RecordScan records scan completion.
func (*Metrics) RecordSearch ¶
RecordSearch records a search attempt for a provider.
func (*Metrics) TotalSearches ¶
TotalSearches returns the cumulative search count across all providers.