hermes_client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// define custom errors
	ErrHermesConnection = errors.New("Cannot connect to hermes server")
	ErrHermesPacketJSON = errors.New("Unable to convert hermes udp packet to JSON format")
)

Functions

This section is empty.

Types

type HermesClient

type HermesClient struct {
	HermesHost string
	HermesPort int
}

struct used to container hermes client details

func New

func New(host string, port int) *HermesClient

function used to generate new hermes client

func (*HermesClient) DecrementGauge

func (c *HermesClient) DecrementGauge(metricName string, labels map[string]string)

function used to decrement gauge value

func (*HermesClient) IncrementCounter

func (c *HermesClient) IncrementCounter(metricName string, labels map[string]string)

function used to increment counter value

func (*HermesClient) IncrementGauge

func (c *HermesClient) IncrementGauge(metricName string, labels map[string]string)

function used to increment gauge value

func (*HermesClient) ObserveHistogram

func (c *HermesClient) ObserveHistogram(metricName string, labels map[string]string, observation float64)

function used to make an observation on a histogram metric

func (*HermesClient) ObserveSummary

func (c *HermesClient) ObserveSummary(metricName string, labels map[string]string, observation float64)

function used to make an observation on a summary metric

func (*HermesClient) SendUDPPacket

func (c *HermesClient) SendUDPPacket(packet interface{}) error

define function used to send UDP packet to Hermes server. UDP Packets are converted to JSON before send

func (*HermesClient) SetGauge

func (c *HermesClient) SetGauge(metricName string, labels map[string]string, gaugeValue float64)

function used to set value ot gauge to a user defined float value

type HermesCounterPacket

type HermesCounterPacket struct {
	MetricName string               `json:"metric_name"`
	Payload    HermesCounterPayload `json:"payload"`
}

type HermesCounterPayload

type HermesCounterPayload struct {
	CounterLabels map[string]string `json:"labels"`
}

type HermesGaugePacket

type HermesGaugePacket struct {
	MetricName string             `json:"metric_name"`
	Payload    HermesGaugePayload `json:"payload"`
}

type HermesGaugePayload

type HermesGaugePayload struct {
	GaugeOperation string            `json:"operation"`
	GaugeValue     *float64          `json:"value"`
	GaugeLabels    map[string]string `json:"labels"`
}

type HermesHistogramPacket

type HermesHistogramPacket struct {
	MetricName string                 `json:"metric_name"`
	Payload    HermesHistogramPayload `json:"payload"`
}

type HermesHistogramPayload

type HermesHistogramPayload struct {
	HistogramObservation float64           `json:"observation"`
	HistogramLabels      map[string]string `json:"labels"`
}

type HermesSummaryPacket

type HermesSummaryPacket struct {
	MetricName string               `json:"metric_name"`
	Payload    HermesSummaryPayload `json:"payload"`
}

type HermesSummaryPayload

type HermesSummaryPayload struct {
	SummaryObservation float64           `json:"observation"`
	SummaryLabels      map[string]string `json:"labels"`
}

Jump to

Keyboard shortcuts

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