producer

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStats

type MemoryStats struct {
	HeapObjects       uint64 `json:"heap_objects"`
	HeapIdleBytes     uint64 `json:"heap_idle_bytes"`
	HeapInUseBytes    uint64 `json:"heap_in_use_bytes"`
	HeapReleasedBytes uint64 `json:"heap_released_bytes"`
	GCPauseUsec100    uint64 `json:"gc_pause_usec_100"`
	GCPauseUsec99     uint64 `json:"gc_pause_usec_99"`
	GCPauseUsec95     uint64 `json:"gc_pause_usec_95"`
	NextGCBytes       uint64 `json:"next_gc_bytes"`
	GCTotalRuns       uint32 `json:"gc_total_runs"`
}

MemoryStats wraps /stats memory data.

type Producer

type Producer struct {
	Version          string `json:"version"`
	RemoteAddress    string `json:"remote_address,omitempty"`
	BroadcastAddress string `json:"broadcast_address"`
	Hostname         string `json:"hostname"`
	HTTPPort         int    `json:"http_port"`
	TCPPort          int64  `json:"tcp_port"`
	StartTime        int    `json:"start_time,omitempty"`
}

Producer represents a nsqd node.

func (Producer) GetStats

func (p Producer) GetStats() (Stats, error)

GetStats retrieves and parses the statistics of a nsqd.

func (Producer) GetTags

func (p Producer) GetTags() []string

GetTags returns the Producer tags including, by default, a tag with its hostname.

func (Producer) HTTPAddress

func (p Producer) HTTPAddress() string

HTTPAddress returns the broadcast address (e.g. 127.0.0.1) joined together with the port (e.g 4151).

type Stats

type Stats struct {
	StatusCode int       `json:"status_code"`
	StatusTxt  string    `json:"status_txt"`
	Data       StatsData `json:"data"`
}

Stats wraps /stats data.

type StatsData

type StatsData struct {
	Version   string            `json:"version"`
	Health    string            `json:"health"`
	StartTime int64             `json:"start_time"`
	Topics    []nsqd.TopicStats `json:"topics"`
	Memory    MemoryStats       `json:"memory"`
}

StatsData is an embedded Stats type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL