lookupd

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2015 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLookupdTopicChannels

func GetLookupdTopicChannels(topic string, lookupdHTTPAddrs []string) ([]string, error)

GetLookupdTopicChannels returns a []string containing a union of the channels from all the given lookupd for the given topic

func GetLookupdTopicProducers

func GetLookupdTopicProducers(topic string, lookupdHTTPAddrs []string) ([]string, error)

GetLookupdTopicProducers returns a []string of the broadcast_address:http_port of all the producers for a given topic by unioning the results returned from the given lookupd

func GetLookupdTopics

func GetLookupdTopics(lookupdHTTPAddrs []string) ([]string, error)

GetLookupdTopics returns a []string containing a union of all the topics from all the given lookupd

func GetNSQDTopicProducers

func GetNSQDTopicProducers(topic string, nsqdHTTPAddrs []string) ([]string, error)

GetNSQDTopicProducers returns a []string containing the addresses of all the nsqd that produce the given topic out of the given nsqd

func GetNSQDTopics

func GetNSQDTopics(nsqdHTTPAddrs []string) ([]string, error)

GetNSQDTopics returns a []string containing all the topics produced by the given nsqd

func GetVersion

func GetVersion(addr string) (semver.Version, error)

GetVersion returns a semver.Version object by querying /info

Types

type ChannelStats

type ChannelStats struct {
	HostAddress   string
	TopicName     string
	ChannelName   string
	Depth         int64
	MemoryDepth   int64
	BackendDepth  int64
	InFlightCount int64
	DeferredCount int64
	RequeueCount  int64
	TimeoutCount  int64
	MessageCount  int64
	ClientCount   int
	Selected      bool
	HostStats     []*ChannelStats
	Clients       []*ClientStats
	Paused        bool

	E2eProcessingLatency *quantile.E2eProcessingLatencyAggregate
}

func (*ChannelStats) Add

func (c *ChannelStats) Add(a *ChannelStats)

func (*ChannelStats) Host

func (c *ChannelStats) Host() string

func (*ChannelStats) Target

func (c *ChannelStats) Target(key string) ([]string, string)

type ChannelStatsByHost

type ChannelStatsByHost struct {
	ChannelStatsList
}

func (ChannelStatsByHost) Less

func (c ChannelStatsByHost) Less(i, j int) bool

type ChannelStatsList

type ChannelStatsList []*ChannelStats

func (ChannelStatsList) Len

func (c ChannelStatsList) Len() int

func (ChannelStatsList) Swap

func (c ChannelStatsList) Swap(i, j int)

type ClientStats

type ClientStats struct {
	HostAddress       string
	RemoteAddress     string
	Version           string
	ClientID          string
	Hostname          string
	UserAgent         string
	ConnectedDuration time.Duration
	InFlightCount     int
	ReadyCount        int
	FinishCount       int64
	RequeueCount      int64
	MessageCount      int64
	SampleRate        int32
	Deflate           bool
	Snappy            bool
	Authed            bool
	AuthIdentity      string
	AuthIdentityURL   string

	TLS                           bool
	CipherSuite                   string `json:"tls_cipher_suite"`
	TLSVersion                    string `json:"tls_version"`
	TLSNegotiatedProtocol         string `json:"tls_negotiated_protocol"`
	TLSNegotiatedProtocolIsMutual bool   `json:"tls_negotiated_protocol_is_mutual"`
}

func (*ClientStats) HasSampleRate

func (c *ClientStats) HasSampleRate() bool

func (*ClientStats) HasUserAgent

func (c *ClientStats) HasUserAgent() bool

type ClientStatsList

type ClientStatsList []*ClientStats

func (ClientStatsList) Len

func (c ClientStatsList) Len() int

func (ClientStatsList) Swap

func (c ClientStatsList) Swap(i, j int)

type ClientsByHost

type ClientsByHost struct {
	ClientStatsList
}

func (ClientsByHost) Less

func (c ClientsByHost) Less(i, j int) bool

type Producer

type Producer struct {
	RemoteAddresses  []string       `json:"remote_addresses"`
	Hostname         string         `json:"hostname"`
	BroadcastAddress string         `json:"broadcast_address"`
	TCPPort          int            `json:"tcp_port"`
	HTTPPort         int            `json:"http_port"`
	Version          string         `json:"version"`
	VersionObj       semver.Version `json:"-"`
	Topics           ProducerTopics `json:"topics"`
	OutOfDate        bool
}

func GetLookupdProducers

func GetLookupdProducers(lookupdHTTPAddrs []string) ([]*Producer, error)

GetLookupdProducers returns a slice of pointers to Producer structs containing metadata for each node connected to given lookupds

func (*Producer) HTTPAddress

func (p *Producer) HTTPAddress() string

func (*Producer) IsInconsistent

func (p *Producer) IsInconsistent(numLookupd int) bool

IsInconsistent checks for cases where an unexpected number of nsqd connections are reporting the same information to nsqlookupd (ie: multiple instances are using the same broadcast address), or cases where some nsqd are not reporting to all nsqlookupd.

func (*Producer) TCPAddress

func (p *Producer) TCPAddress() string

type ProducerList

type ProducerList []*Producer

func (ProducerList) Len

func (t ProducerList) Len() int

func (ProducerList) Swap

func (t ProducerList) Swap(i, j int)

type ProducerTopic

type ProducerTopic struct {
	Topic      string `json:"topic"`
	Tombstoned bool   `json:"tombstoned"`
}

type ProducerTopics

type ProducerTopics []ProducerTopic

func (ProducerTopics) Len

func (pt ProducerTopics) Len() int

func (ProducerTopics) Less

func (pt ProducerTopics) Less(i, j int) bool

func (ProducerTopics) Swap

func (pt ProducerTopics) Swap(i, j int)

type ProducersByHost

type ProducersByHost struct {
	ProducerList
}

func (ProducersByHost) Less

func (c ProducersByHost) Less(i, j int) bool

type TopicStats

type TopicStats struct {
	HostAddress  string
	TopicName    string
	Depth        int64
	MemoryDepth  int64
	BackendDepth int64
	MessageCount int64
	ChannelCount int
	Aggregate    bool
	Channels     []*ChannelStats
	Paused       bool

	E2eProcessingLatency *quantile.E2eProcessingLatencyAggregate
}

func GetNSQDStats

func GetNSQDStats(nsqdHTTPAddrs []string, selectedTopic string) ([]*TopicStats, map[string]*ChannelStats, error)

GetNSQDStats returns aggregate topic and channel stats from the given NSQD instances

if selectedTopic is empty, this will return stats for *all* topic/channels and the ChannelStats dict will be keyed by topic + ':' + channel

func (*TopicStats) Add

func (t *TopicStats) Add(a *TopicStats)

func (*TopicStats) Host

func (t *TopicStats) Host() string

func (*TopicStats) Target

func (t *TopicStats) Target(key string) ([]string, string)

type TopicStatsByHost

type TopicStatsByHost struct {
	TopicStatsList
}

func (TopicStatsByHost) Less

func (c TopicStatsByHost) Less(i, j int) bool

type TopicStatsList

type TopicStatsList []*TopicStats

func (TopicStatsList) Len

func (t TopicStatsList) Len() int

func (TopicStatsList) Swap

func (t TopicStatsList) Swap(i, j int)

Jump to

Keyboard shortcuts

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