mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
feat(metrics): adding prometheus metrics for dc power extension (#556)
This commit is contained in:
committed by
GitHub
parent
d704fcc6c7
commit
aada3d95e0
@@ -128,6 +128,7 @@ func pressATXResetButton(duration time.Duration) error {
|
||||
|
||||
func mountDCControl() error {
|
||||
_ = port.SetMode(defaultMode)
|
||||
registerDCMetrics()
|
||||
go runDCControl()
|
||||
return nil
|
||||
}
|
||||
@@ -206,6 +207,9 @@ func runDCControl() {
|
||||
dcState.Current = amps
|
||||
dcState.Power = watts
|
||||
|
||||
// Update Prometheus metrics
|
||||
updateDCMetrics(dcState)
|
||||
|
||||
if currentSession != nil {
|
||||
writeJSONRPCEvent("dcState", dcState, currentSession)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user