Native bucket factor

This commit is contained in:
Josh Deprez 2024-09-30 15:00:53 +10:00
parent a5d989b3b7
commit 237a2d1f8d

View file

@ -38,12 +38,47 @@ var (
lifepo4weredPOutSummary = jmetrics.NewLiteGaugeSummary("lifepo4wered_power_out", "Power out (mW)")
lifepo4weredHists = map[string]prometheus.Histogram{
"VIN": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "voltage_in", Help: "Voltage in (mV)"}),
"VOUT": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "voltage_out", Help: "Voltage out (mV)"}),
"VBAT": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "voltage_bat", Help: "Battery voltage (mV)"}),
"IOUT": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "current_out", Help: "Current out (mA)"}),
"VIN": promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "lifepo4wered",
Subsystem: "hist",
Name: "voltage_in",
Help: "Voltage in (mV)",
NativeHistogramZeroThreshold: 0.001,
NativeHistogramBucketFactor: 1.001,
}),
"VOUT": promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "lifepo4wered",
Subsystem: "hist",
Name: "voltage_out",
Help: "Voltage out (mV)",
NativeHistogramZeroThreshold: 0.001,
NativeHistogramBucketFactor: 1.001,
}),
"VBAT": promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "lifepo4wered",
Subsystem: "hist",
Name: "voltage_bat",
Help: "Battery voltage (mV)",
NativeHistogramZeroThreshold: 0.001,
NativeHistogramBucketFactor: 1.001,
}),
"IOUT": promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "lifepo4wered",
Subsystem: "hist",
Name: "current_out",
Help: "Current out (mA)",
NativeHistogramZeroThreshold: 0.001,
NativeHistogramBucketFactor: 1.001,
}),
}
lifepo4weredPOutHist = promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "power_out", Help: "Power out (mW)"})
lifepo4weredPOutHist = promauto.NewHistogram(prometheus.HistogramOpts{
Namespace: "lifepo4wered",
Subsystem: "hist",
Name: "power_out",
Help: "Power out (mW)",
NativeHistogramZeroThreshold: 0.001,
NativeHistogramBucketFactor: 1.001,
})
)
func pollVars() {