check

package
v0.0.0-...-1ee1679 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerConnection

type BrokerConnection interface {
	Dial(nodeAddresses []string, conf kafka.Config) error

	Consumer(conf kafka.Config) (kafka.Consumer, error)

	Producer(conf kafka.Config) kafka.SyncProducer

	Metadata() (*kafka.MetadataResponse, error)

	Close()
}

BrokerConnection represents a connection to the Kafka broker

type BrokerMetadata

type BrokerMetadata struct {
	ID      int32  `json:"broker"`
	Status  string `json:"status"`
	Problem string `json:"problem"`
}

type BrokerStatus

type BrokerStatus struct {
	Status              string              `json:"status"`
	OutOfSync           []ReplicationStatus `json:"out-of-sync,omitempty"`
	ReplicationFailures uint                `json:"replication-failures,omitempty"`
}

func (BrokerStatus) Json

func (s BrokerStatus) Json() (data []byte, err error)

func (BrokerStatus) Summary

func (s BrokerStatus) Summary() string

type ClusterStatus

type ClusterStatus struct {
	Status    string           `json:"status"`
	Topics    []TopicStatus    `json:"topics,omitempty"`
	Metadata  []BrokerMetadata `json:"metadata,omitempty"`
	ZooKeeper string           `json:"zookeeper-connection,omitempty"`
}

func (ClusterStatus) Json

func (s ClusterStatus) Json() (data []byte, err error)

func (ClusterStatus) Summary

func (s ClusterStatus) Summary() string

type HealthCheck

type HealthCheck struct {
	// contains filtered or unexported fields
}

HealthCheck holds all data required for health checking.

func New

func New(config HealthCheckConfig) *HealthCheck

New creates a new health check with the given config.

func (*HealthCheck) CheckHealth

func (check *HealthCheck) CheckHealth(brokerUpdates chan<- Update, clusterUpdates chan<- Update, stop <-chan struct{})

CheckHealth checks broker and cluster health.

func (*HealthCheck) ParseCommandLineArguments

func (check *HealthCheck) ParseCommandLineArguments()

ParseCommandLineArguments parses the command line arguments.

func (*HealthCheck) ServeHealth

func (check *HealthCheck) ServeHealth(brokerUpdates <-chan Update, clusterUpdates <-chan Update, stop <-chan struct{})

ServeHealth answers http queries for broker and cluster health.

type HealthCheckConfig

type HealthCheckConfig struct {
	MessageLength    int
	CheckInterval    time.Duration
	CheckTimeout     time.Duration
	DataWaitInterval time.Duration
	NoTopicCreation  bool
	// contains filtered or unexported fields
}

HealthCheckConfig is the configuration for the health check.

type MockBrokerConnection

type MockBrokerConnection struct {
	// contains filtered or unexported fields
}

Mock of BrokerConnection interface

func NewMockBrokerConnection

func NewMockBrokerConnection(ctrl *gomock.Controller) *MockBrokerConnection

func (*MockBrokerConnection) Close

func (_m *MockBrokerConnection) Close()

func (*MockBrokerConnection) Consumer

func (*MockBrokerConnection) Dial

func (_m *MockBrokerConnection) Dial(nodeAddresses []string, conf kafka.BrokerConf) error

func (*MockBrokerConnection) EXPECT

func (_m *MockBrokerConnection) EXPECT() *_MockBrokerConnectionRecorder

func (*MockBrokerConnection) Metadata

func (_m *MockBrokerConnection) Metadata() (*proto.MetadataResp, error)

func (*MockBrokerConnection) Producer

type MockZkConnection

type MockZkConnection struct {
	// contains filtered or unexported fields
}

Mock of ZkConnection interface

func NewMockZkConnection

func NewMockZkConnection(ctrl *gomock.Controller) *MockZkConnection

func (*MockZkConnection) Children

func (_m *MockZkConnection) Children(path string) ([]string, *zk.Stat, error)

func (*MockZkConnection) Close

func (_m *MockZkConnection) Close()

func (*MockZkConnection) Connect

func (_m *MockZkConnection) Connect(servers []string, sessionTimeout time.Duration) (<-chan zk.Event, error)

func (*MockZkConnection) Create

func (_m *MockZkConnection) Create(path string, data []byte, flags int32, acl []zk.ACL) (string, error)

func (*MockZkConnection) EXPECT

func (_m *MockZkConnection) EXPECT() *_MockZkConnectionRecorder

func (*MockZkConnection) Exists

func (_m *MockZkConnection) Exists(path string) (bool, *zk.Stat, error)

func (*MockZkConnection) Get

func (_m *MockZkConnection) Get(path string) ([]byte, *zk.Stat, error)

func (*MockZkConnection) Set

func (_m *MockZkConnection) Set(path string, data []byte, version int32) (*zk.Stat, error)

type PartitionStatus

type PartitionStatus struct {
	Status            string  `json:"status"`
	ZooKeeper         string  `json:"zookeeper,omitempty"`
	OutOfSyncReplicas []int32 `json:"OSR,omitempty"`
}

type ReplicationStatus

type ReplicationStatus struct {
	Topic     string `json:"topic"`
	Partition int32  `json:"partition"`
}

type StatusReport

type StatusReport interface {
	Summary() string
	Json() ([]byte, error)
}

type TopicStatus

type TopicStatus struct {
	Topic      string                     `json:"topic"`
	Status     string                     `json:"status"`
	ZooKeeper  string                     `json:"zookeeper,omitempty"`
	Partitions map[string]PartitionStatus `json:"partitions,omitempty"`
}

type Update

type Update struct {
	Status string
	Data   []byte
}

type ZkConnection

type ZkConnection interface {
	Connect(servers []string, sessionTimeout time.Duration) (<-chan zk.Event, error)
	Close()
	Exists(path string) (bool, *zk.Stat, error)
	Set(path string, data []byte, version int32) (*zk.Stat, error)
	Create(path string, data []byte, flags int32, acl []zk.ACL) (string, error)
	Children(path string) ([]string, *zk.Stat, error)
	Get(path string) ([]byte, *zk.Stat, error)
}

ZkConnection represents a connection to a ZooKeeper ensemble

type ZkTopic

type ZkTopic struct {
	Name       string
	Partitions map[string][]int32 `json:"partitions"`
}

Jump to

Keyboard shortcuts

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