go-micro: github.com/micro/go-micro/debug/stats Index | Files

package stats

import "github.com/micro/go-micro/debug/stats"

Package stats provides runtime stats

Index

Package Files

default.go stats.go

Variables

var (
    DefaultStats = NewStats()
)

type Stat Uses

type Stat struct {
    // Timestamp of recording
    Timestamp int64
    // Start time as unix timestamp
    Started int64
    // Uptime in seconds
    Uptime int64
    // Memory usage in bytes
    Memory uint64
    // Threads aka go routines
    Threads uint64
    // Garbage collection in nanoseconds
    GC  uint64
    // Total requests
    Requests uint64
    // Total errors
    Errors uint64
}

A runtime stat

type Stats Uses

type Stats interface {
    // Read stat snapshot
    Read() ([]*Stat, error)
    // Write a stat snapshot
    Write(*Stat) error
    // Record a request
    Record(error) error
}

Stats provides stats interface

func NewStats Uses

func NewStats() Stats

NewStats returns a new in memory stats buffer TODO add options

Package stats imports 4 packages (graph) and is imported by 6 packages. Updated 2020-02-17. Refresh now. Tools for package owners.