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)") lifepo4weredPOutSummary = jmetrics.NewLiteGaugeSummary("lifepo4wered_power_out", "Power out (mW)")
lifepo4weredHists = map[string]prometheus.Histogram{ lifepo4weredHists = map[string]prometheus.Histogram{
"VIN": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "voltage_in", Help: "Voltage in (mV)"}), "VIN": promauto.NewHistogram(prometheus.HistogramOpts{
"VOUT": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "voltage_out", Help: "Voltage out (mV)"}), Namespace: "lifepo4wered",
"VBAT": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "voltage_bat", Help: "Battery voltage (mV)"}), Subsystem: "hist",
"IOUT": promauto.NewHistogram(prometheus.HistogramOpts{Namespace: "lifepo4wered", Subsystem: "hist", Name: "current_out", Help: "Current out (mA)"}), 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() { func pollVars() {