Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Drops() int64
- func (m *Manager) Errors() int64
- func (m *Manager) Memory() uint64
- func (m *Manager) Now() (read, publish int64)
- func (m *Manager) PushDrop(count int64)
- func (m *Manager) PushError()
- func (m *Manager) PushPublish(count int64)
- func (m *Manager) PushRead(count int64)
- func (m *Manager) ResetStatistic()
- func (m *Manager) Snapshot() *Snapshot
- func (m *Manager) Total() (read, publish int64)
- func (m *Manager) Uptime() time.Duration
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager collects and manages system statistics.
var DefaultManager *Manager
DefaultManager is the default global statistics manager.
func (*Manager) PushPublish ¶
PushPublish increments the publish counter.
func (*Manager) ResetStatistic ¶
func (m *Manager) ResetStatistic()
ResetStatistic resets the total counters.
type Snapshot ¶
type Snapshot struct {
ReadTotal int64 `json:"read_total"`
PublishTotal int64 `json:"publish_total"`
ErrorTotal int64 `json:"error_total"`
DropTotal int64 `json:"drop_total"`
ReadPerSec int64 `json:"read_per_sec"`
PublishPerSec int64 `json:"publish_per_sec"`
Uptime time.Duration `json:"uptime"`
Memory uint64 `json:"memory"`
}
Snapshot returns a snapshot of current statistics.