metrics

package
v0.0.0-...-7febb3a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LastUpdate

func LastUpdate() time.Time

func ReportClient

func ReportClient(pattern, side, channel string, value float64)

func ReportDelayed

func ReportDelayed(channel string, value float64)

func ReportEvent

func ReportEvent(event *pb.Event, result *pb.Result)

func ReportEventReceive

func ReportEventReceive(event *pb.EventReceive, subReq *pb.Subscribe)

func ReportExpired

func ReportExpired(channel string, value float64)

func ReportPending

func ReportPending(pattern, clientId, channel string, value float64)

func ReportQueueUpstreamRequest

func ReportQueueUpstreamRequest(req *pb.QueuesUpstreamRequest)

func ReportReceiveQueueMessages

func ReportReceiveQueueMessages(request *pb.ReceiveQueueMessagesRequest, response *pb.ReceiveQueueMessagesResponse)

func ReportReceiveStreamQueueMessage

func ReportReceiveStreamQueueMessage(message *pb.QueueMessage)

func ReportRequest

func ReportRequest(request *pb.Request, response *pb.Response, err error)

func ReportResponse

func ReportResponse(response *pb.Response, err error)

func ReportSendQueueMessage

func ReportSendQueueMessage(msg *pb.QueueMessage, res *pb.SendQueueMessageResult)

func ReportSendQueueMessageBatch

func ReportSendQueueMessageBatch(batch *pb.QueueMessagesBatchRequest, res *pb.QueueMessagesBatchResponse)

Types

type ChannelStats

type ChannelStats struct {
	Kind          string  `json:"kind"`
	Name          string  `json:"name"`
	TotalMessages float64 `json:"total_messages"`
	TotalVolume   float64 `json:"total_volume"`
	TotalErrors   float64 `json:"total_errors"`
}

type ChannelsSummery

type ChannelsSummery struct {
	Kind          string  `json:"kind"`
	TotalChannels int     `json:"total_channels"`
	TotalMessages float64 `json:"total_messages"`
	TotalVolume   float64 `json:"total_volume"`
	TotalErrors   float64 `json:"total_errors"`
}

type ClientsStats

type ClientsStats struct {
	Name          string  `json:"name"`
	TotalMessages float64 `json:"total_messages"`
	TotalVolume   float64 `json:"total_volume"`
	TotalErrors   float64 `json:"total_errors"`
	TotalPending  float64 `json:"total_pending"`
}

func (*ClientsStats) Empty

func (cs *ClientsStats) Empty() bool

type Counters

type Counters struct {
	Hostname    string  `json:"hostname"`
	Uptime      float64 `json:"uptime"`
	Messages    int64   `json:"messages"`
	Volume      float64 `json:"volume"`
	LastMessage int64   `json:"last_message"`
}

type CountersController

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

type Exporter

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

func GetExporter

func GetExporter() *Exporter

func InitExporter

func InitExporter(ctx context.Context) *Exporter

func (*Exporter) ChannelSummery

func (e *Exporter) ChannelSummery(cs ...[]*ChannelStats) ([]*ChannelsSummery, error)

func (*Exporter) Channels

func (e *Exporter) Channels() ([]*ChannelStats, error)

func (*Exporter) Clients

func (e *Exporter) Clients() ([]*ClientsStats, int, error)

func (*Exporter) CountersSummery

func (e *Exporter) CountersSummery() (*Counters, error)

func (*Exporter) MetricsDropped

func (e *Exporter) MetricsDropped() uint64

func (*Exporter) PrometheusHandler

func (e *Exporter) PrometheusHandler() http.Handler

func (*Exporter) PrometheusString

func (e *Exporter) PrometheusString() (string, error)

func (*Exporter) Snapshot

func (e *Exporter) Snapshot() (*api.Snapshot, error)

func (*Exporter) Stats

func (e *Exporter) Stats() ([]*Stats, error)

type Family

type Family struct {
	//Time    time.Time
	Name    string        `json:"name"`
	Help    string        `json:"help"`
	Type    string        `json:"type"`
	Metrics []interface{} `json:"metrics,omitempty"` // Either metric or summary.
}

Family mirrors the MetricFamily proto message.

func NewFamily

func NewFamily(dtoMF *dto.MetricFamily) *Family

NewFamily consumes a MetricFamily and transforms it to the local Family type.

type Histogram

type Histogram struct {
	Labels      map[string]string `json:"labels,omitempty"`
	TimestampMs string            `json:"timestamp_ms,omitempty"`
	Buckets     map[string]string `json:"buckets,omitempty"`
	Count       string            `json:"count"`
	Sum         string            `json:"sum"`
}

Histogram mirrors the Histogram proto message.

type Metric

type Metric struct {
	Labels      map[string]string `json:"labels,omitempty"`
	TimestampMs string            `json:"timestamp_ms,omitempty"`
	Value       string            `json:"value"`
}

Metric is for all "single value" metrics, i.e. Counter, Gauge, and Untyped.

type Stats

type Stats struct {
	Name     string
	Node     string
	Type     string
	Side     string
	Channel  string
	ClientId string
	Value    string
}

func (*Stats) Float64

func (s *Stats) Float64() float64

func (*Stats) Int64

func (s *Stats) Int64() int64

func (*Stats) Kind

func (s *Stats) Kind() string

type Summary

type Summary struct {
	Labels      map[string]string `json:"labels,omitempty"`
	TimestampMs string            `json:"timestamp_ms,omitempty"`
	Quantiles   map[string]string `json:"quantiles,omitempty"`
	Count       string            `json:"count"`
	Sum         string            `json:"sum"`
}

Summary mirrors the Summary proto message.

Jump to

Keyboard shortcuts

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