Standard library / runtime/metrics

metrics.Value.Uint64()

Returns the unsigned integer value; panics if the kind is not KindUint64. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) Uint64() uint64

Return Value

uint64

Unsigned value of a metric tagged KindUint64.

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime/metrics")
func main() {  s := []metrics.Sample{{Name: "/gc/heap/allocs:bytes"}}  metrics.Read(s)  fmt.Println(s[0].Value.Uint64() > 0)}
Go Reference