MCPcopy
hub / github.com/bnb-chain/bsc / WriteJSONOnce

Function WriteJSONOnce

metrics/json.go:25–27  ·  view source on GitHub ↗

WriteJSONOnce writes metrics from the given registry to the specified io.Writer as JSON.

(r Registry, w io.Writer)

Source from the content-addressed store, hash-verified

23// WriteJSONOnce writes metrics from the given registry to the specified
24// io.Writer as JSON.
25func WriteJSONOnce(r Registry, w io.Writer) {
26 json.NewEncoder(w).Encode(r)
27}
28
29func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) {
30 return json.Marshal(p.GetAll())

Callers 2

WriteJSONFunction · 0.85

Calls 1

EncodeMethod · 0.65

Tested by 1