refactor(metrics): optimize and simplify system info; add gopsutil as submodule

This commit is contained in:
yusing
2025-10-05 12:05:58 +08:00
parent ae57edfcb0
commit 74224c8e87
15 changed files with 100 additions and 290 deletions

View File

@@ -1,8 +1,9 @@
package atomic
import (
"encoding/json"
"sync/atomic"
"github.com/bytedance/sonic"
)
type Value[T any] struct {
@@ -30,5 +31,5 @@ func (a *Value[T]) Swap(v T) T {
}
func (a *Value[T]) MarshalJSON() ([]byte, error) {
return json.Marshal(a.Load())
return sonic.Marshal(a.Load())
}