Versions in this module Expand all Collapse all v0 v0.0.4 Jul 21, 2022 v0.0.3 Jun 25, 2022 Changes in this version + func AddInt(ctx context.Context, m string, n int, u units.Unit) int + func Child(ctx context.Context, name string) (context.Context, func()) + func Close(ctx context.Context) + func RenderTree(buf *bytes.Buffer, x *Collector, indent string) error + func SetDenom(ctx context.Context, m string, n int, u units.Unit) + func WithCollector(ctx context.Context, r *Collector) context.Context + type Collector struct + func FromContext(ctx context.Context) *Collector + func NewCollector() *Collector + func (r *Collector) AddInt(m string, delta int, u units.Unit) int + func (r *Collector) AddInt64(m string, delta int64, u units.Unit) (ret int64) + func (r *Collector) Child(name string) *Collector + func (r *Collector) Close() + func (r *Collector) Duration() time.Duration + func (r *Collector) GetChild(id uint) *Collector + func (r *Collector) GetCounter(m string) *Counter + func (r *Collector) IsClosed() bool + func (r *Collector) List() []string + func (r *Collector) ListChildren() []uint + func (r *Collector) Name() string + func (r *Collector) SetDenom(m string, x int64, u units.Unit) + func (r *Collector) SetInt64(m string, x int64, u units.Unit) + type Counter struct + func (c *Counter) Absorb(c2 *Counter) + func (c *Counter) Add(now time.Time, d int64, u units.Unit) int64 + func (c *Counter) Get() Value + func (c *Counter) GetDelta() Value + func (c *Counter) GetDenom() Value + func (c *Counter) Set(now time.Time, x int64, u units.Unit) + func (c *Counter) SetDenom(x int64, u units.Unit) + func (c *Counter) String() string + type Renderer struct + func NewTTYRenderer(s *Collector, out io.Writer) *Renderer + func (r *Renderer) Close() error + type Summary struct + EndAt time.Time + Metrics map[string]Value + Name string + StartAt time.Time + func (s *Summary) Elapsed() time.Duration + func (s *Summary) GetDelta(k string) float64 + func (s *Summary) String() string + type Value struct + Units units.Unit + X float64 + func (v Value) String() string