add more important node stats

This commit is contained in:
2026-07-08 11:47:07 +02:00
committed by T. von Dein
parent 76ad6c7afa
commit 068711589b
3 changed files with 35 additions and 8 deletions

View File

@@ -22,8 +22,8 @@ type ByteSize struct {
size uint64
}
func Bytes(size int64) ByteSize {
return ByteSize{size: uint64(size)}
func Bytes(size int64) *ByteSize {
return &ByteSize{size: uint64(size)}
}
func (b *ByteSize) String() string {

View File

@@ -38,12 +38,16 @@ func any2string(in any) string {
return strconv.Itoa(val)
case float64:
return fmt.Sprintf("%.2f", val)
case float32:
return fmt.Sprintf("%.2f", val)
case []string:
return strings.Join(val, ",")
case ByteSize:
return val.String()
case time.Time:
return val.Format("2006-01-02 15:04:05")
case time.Duration:
return val.String()
case []byte:
return string(val)
case nil: