data

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBoolToInt

func ConvertBoolToInt(val bool) (returnval int)

ConvertBoolToInt converts a boolean to it's metric/inventory representation

func CreateEntity

func CreateEntity(rabbitmqIntegration *integration.Integration, entityName, entityType, vhost, clusterName string) (entity *integration.Entity, metricNamespace []metric.Attribute, err error)

CreateEntity will create an entity and metricNamespace attributes with appropriate name/namespace values if the entity isn't filtered

func SetInventoryItem

func SetInventoryItem(entity *integration.Entity, category, key string, value interface{})

SetInventoryItem sets an inventory item in a consistent way

Types

type Binding

type Binding struct {
	Source      []*BindingKey
	Destination []*BindingKey
}

Binding contains a list of Source and Destination BindingKeys

type BindingData

type BindingData struct {
	Vhost           string
	Source          string
	Destination     string
	DestinationType string `json:"destination_type"`
}

BindingData is the representation of the bindings endpoint

type BindingKey

type BindingKey struct {
	Vhost, EntityName, EntityType string
}

BindingKey is used to uniquely identify a binding by Vhost, EntityName, and EntityType

type BindingStats

type BindingStats map[BindingKey]*Binding

BindingStats contains the calculation for Source/Destination Binding for each entity/BindingKey

type ConnectionData

type ConnectionData struct {
	Vhost string
	State string
}

ConnectionData is the representation of the connections endpoint

type EntityData

type EntityData interface {
	GetEntity(integration *integration.Integration, entityName string) (*integration.Entity, []metric.Attribute, error)
	EntityVhost() string
	EntityName() string
	EntityType() string
}

EntityData is capable of reporting it's own data to inventory

type ExchangeData

type ExchangeData struct {
	Name         string
	Vhost        string
	MessageStats struct {
		PublishIn        *int64 `json:"publish_in" metric_name:"exchange.messagesPublishedPerChannel" source_type:"gauge"`
		PublishOut       *int64 `json:"publish_out" metric_name:"exchange.messagesPublishedQueue" source_type:"gauge"`
		PublishInDetails struct {
			Rate *float64 `metric_name:"exchange.messagesPublishedPerChannelPerSecond" source_type:"gauge"`
		} `json:"publish_in_details"`
		PublishOutDetails struct {
			Rate *float64 `metric_name:"exchange.messagesPublishedQueuePerSecond" source_type:"gauge"`
		} `json:"publish_out_details"`
	} `json:"message_stats"`
	Type       string
	Durable    bool
	AutoDelete bool `json:"auto_delete"`
	Arguments  map[string]interface{}
}

ExchangeData is the representation of the exchanges endpoint

func (*ExchangeData) CollectInventory

func (e *ExchangeData) CollectInventory(entity *integration.Entity, bindingStats BindingStats)

CollectInventory collects inventory data and reports it to the integration.Entity

func (*ExchangeData) EntityName

func (e *ExchangeData) EntityName() string

EntityName returns the main name of this entity

func (*ExchangeData) EntityType

func (e *ExchangeData) EntityType() string

EntityType returns the type of this entity

func (*ExchangeData) EntityVhost

func (e *ExchangeData) EntityVhost() string

EntityVhost returns the vhost of this entity

func (*ExchangeData) GetEntity

func (e *ExchangeData) GetEntity(integration *integration.Integration, clusterName string) (*integration.Entity, []metric.Attribute, error)

GetEntity creates an integration.Entity for this ExchangeData

type NodeData

type NodeData struct {
	Name                 string
	ConfigFiles          []string `json:"config_files"`
	DiskAlarm            *bool    `json:"disk_free_alarm" metric_name:"node.diskAlarm" source_type:"gauge"`
	DiskFreeSpace        *int64   `json:"disk_free" metric_name:"node.diskSpaceFreeInBytes" source_type:"gauge"`
	FileDescriptorsUsed  *int64   `json:"fd_used" metric_name:"node.fileDescriptorsTotalUsed" source_type:"gauge"`
	FileDescriptorsTotal *int64   `json:"fd_total" metric_name:"node.fileDescriptorsTotal" source_type:"gauge"`
	ProcessesTotal       *int64   `json:"proc_total" metric_name:"node.processesTotal" source_type:"gauge"`
	ProcessesUsed        *int64   `json:"proc_used" metric_name:"node.processesUsed" source_type:"gauge"`
	MemoryAlarm          *bool    `json:"mem_alarm" metric_name:"node.hostMemoryAlarm" source_type:"gauge"`
	MemoryUsed           *int64   `json:"mem_used" metric_name:"node.totalMemoryUsedInBytes" source_type:"gauge"`
	Partitions           int      `json:"-" metric_name:"node.partitionsSeen" source_type:"gauge"`
	Running              *bool    `metric_name:"node.running" source_type:"gauge"`
	RunQueue             *int64   `json:"run_queue" metric_name:"node.averageErlangProcessesWaiting" source_type:"gauge"`
	SocketsTotal         *int64   `json:"sockets_total" metric_name:"node.fileDescriptorsTotalSockets" source_type:"gauge"`
	SocketsUsed          *int64   `json:"sockets_used" metric_name:"node.fileDescriptorsUsedSockets" source_type:"gauge"`
}

NodeData is the representation of the nodes endpoint

func (*NodeData) EntityName

func (n *NodeData) EntityName() string

EntityName returns the main name of this entity

func (*NodeData) EntityType

func (n *NodeData) EntityType() string

EntityType returns the type of this entity

func (*NodeData) EntityVhost

func (n *NodeData) EntityVhost() string

EntityVhost returns the vhost of this entity

func (*NodeData) GetEntity

func (n *NodeData) GetEntity(integration *integration.Integration, clusterName string) (*integration.Entity, []metric.Attribute, error)

GetEntity creates an integration.Entity for this NodeData

func (*NodeData) UnmarshalJSON

func (n *NodeData) UnmarshalJSON(data []byte) error

UnmarshalJSON handles custom JSON Unmarshaling in order to convert values to metrics

type NodeTest

type NodeTest struct {
	Node *NodeData
	Test *TestData
}

NodeTest holds data around a test against a Node

type OverviewData

type OverviewData struct {
	ClusterName       string `json:"cluster_name"`
	RabbitMQVersion   string `json:"rabbitmq_version"`
	ManagementVersion string `json:"management_version"`
}

OverviewData is the representation of the overview endpoint

type QueueData

type QueueData struct {
	Name                string
	Vhost               string
	Exclusive           bool
	Durable             bool
	Arguments           map[string]interface{}
	AutoDelete          bool     `json:"auto_delete"`
	Consumers           *int64   `metric_name:"queue.consumers" source_type:"gauge"`
	ConsumerUtilisation *float64 `json:"consumer_utilisation" metric_name:"queue.consumerMessageUtilizationPerSecond" source_type:"gauge"`
	ActiveConsumers     *int64   `json:"active_consumers" metric_name:"queue.countActiveConsumersReceiveMessages" source_type:"gauge"`
	Memory              *int64   `metric_name:"queue.erlangBytesConsumedInBytes" source_type:"gauge"`
	Messages            *int64   `metric_name:"queue.totalMessages" source_type:"gauge"`
	MessagesDetails     struct {
		Rate *float64 `metric_name:"queue.totalMessagesPerSecond" source_type:"gauge"`
	} `json:"messages_details"`
	MessagesReady       *int64 `json:"messages_ready" metric_name:"queue.messagesReadyDeliveryClients" source_type:"gauge"`
	MessagesReadyDetail struct {
		Rate *float64 `metric_name:"queue.messagesReadyDeliveryClientsPerSecond" source_type:"gauge"`
	} `json:"messages_ready_details"`
	MessagesUnacknowledged       *int64 `json:"messages_unacknowledged" metric_name:"queue.messagesReadyUnacknowledged" source_type:"gauge"`
	MessagesUnacknowledgedDetail struct {
		Rate *float64 `metric_name:"queue.messagesReadyUnacknowledgedPerSecond" source_type:"gauge"`
	} `json:"messages_unacknowledged_details"`
	MessageStats struct {
		Ack        *int64 `metric_name:"queue.messagesAcknowledged" source_type:"gauge"`
		AckDetails struct {
			Rate *float64 `metric_name:"queue.messagesAcknowledgedPerSecond" source_type:"gauge"`
		} `json:"ack_details"`
		Deliver        *int64 `json:"deliver" metric_name:"queue.messagesDeliveredAckMode" source_type:"gauge"`
		DeliverDetails struct {
			Rate *float64 `metric_name:"queue.messagesDeliveredAckModePerSecond" source_type:"gauge"`
		} `json:"deliver_details"`
		DeliverGet        *int64 `json:"deliver_get" metric_name:"queue.sumMessagesDelivered" source_type:"gauge"`
		DeliverGetDetails struct {
			Rate *float64 `metric_name:"queue.sumMessagesDeliveredPerSecond" source_type:"gauge"`
		} `json:"deliver_get_details"`
		Publish        *int64 `metric_name:"queue.messagesPublished" source_type:"gauge"`
		PublishDetails struct {
			Rate *float64 `metric_name:"queue.messagesPublishedPerSecond" source_type:"gauge"`
		} `json:"publish_details"`
		Redeliver        *int64 `metric_name:"queue.messagesRedeliverGet" source_type:"gauge"`
		RedeliverDetails struct {
			Rate *float64 `metric_name:"queue.messagesRedeliverGetPerSecond" source_type:"gauge"`
		} `json:"redeliver_details"`
	} `json:"message_stats"`
}

QueueData is the representation of the queues endpoint

func (*QueueData) CollectInventory

func (q *QueueData) CollectInventory(entity *integration.Entity, bindingStats BindingStats)

CollectInventory collects inventory data and reports it to the integration.Entity

func (*QueueData) EntityName

func (q *QueueData) EntityName() string

EntityName returns the main name of this entity

func (*QueueData) EntityType

func (q *QueueData) EntityType() string

EntityType returns the type of this entity

func (*QueueData) EntityVhost

func (q *QueueData) EntityVhost() string

EntityVhost returns the vhost of this entity

func (*QueueData) GetEntity

func (q *QueueData) GetEntity(integration *integration.Integration, clusterName string) (*integration.Entity, []metric.Attribute, error)

GetEntity creates an integration.Entity for this QueueData

type TestData

type TestData struct {
	Status string
	Reason string
}

TestData is the representation of both the AlivenessTest and Healthchecks endpoints

type VhostData

type VhostData struct {
	Name string
}

VhostData is the representation of the vhosts endpoint

type VhostTest

type VhostTest struct {
	Vhost *VhostData
	Test  *TestData
}

VhostTest holds data around a test against a Vhost

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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