logging tweaks and improvements releated to limits agent (#606)

This commit is contained in:
Michael Quigley
2024-06-11 12:00:12 -04:00
parent 5e6ec4cde1
commit 883fe92848
7 changed files with 23 additions and 25 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/openziti/zrok/controller/store"
"github.com/openziti/zrok/sdk/golang/sdk"
"github.com/openziti/zrok/util"
)
type configBandwidthClass struct {
@ -70,13 +71,13 @@ func (bc *configBandwidthClass) GetLimitAction() store.LimitAction {
func (bc *configBandwidthClass) String() string {
out := fmt.Sprintf("ConfigClass<periodMinutes: %d", bc.periodInMinutes)
if bc.bw.Rx > store.Unlimited {
out += fmt.Sprintf(", rxBytes: %d", bc.bw.Rx)
out += fmt.Sprintf(", rxBytes: %v", util.BytesToSize(bc.bw.Rx))
}
if bc.bw.Tx > store.Unlimited {
out += fmt.Sprintf(", txBytes: %d", bc.bw.Tx)
out += fmt.Sprintf(", txBytes: %v", util.BytesToSize(bc.bw.Tx))
}
if bc.bw.Total > store.Unlimited {
out += fmt.Sprintf(", totalBytes: %d", bc.bw.Total)
out += fmt.Sprintf(", totalBytes: %v", util.BytesToSize(bc.bw.Total))
}
out += fmt.Sprintf(", limitAction: %s>", bc.limitAction)
return out