metric

package
v0.0.0-...-4c68550 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanTrackStats

func CleanTrackStats(labels Labels)

func ExtendRouter

func ExtendRouter(router *mux.Router, config *MetricConfig) error

func FirDel

func FirDel(labels Labels)

func FirInc

func FirInc(labels Labels, fir uint32)

func GetPrometheusMiddleware

func GetPrometheusMiddleware(m *HttpMetric) func(http.Handler) http.Handler

func GraphAddEdge

func GraphAddEdge(sessionId string, liveStreamId string, nodeType string)

func GraphDeleteEdge

func GraphDeleteEdge(sessionId string, liveStreamId string, nodeType string)

func GraphNodeDelete

func GraphNodeDelete(node GraphNode)

func JitterDel

func JitterDel(labels Labels)

func JitterInc

func JitterInc(labels Labels, jitter float64)

func NackDel

func NackDel(labels Labels)

func NackInc

func NackInc(labels Labels, nack uint32)

func PacketBytesDel

func PacketBytesDel(labels Labels)

func PacketBytesInc

func PacketBytesInc(labels Labels, pkg uint64)

func PacketDel

func PacketDel(labels Labels)

func PacketInc

func PacketInc(labels Labels, pkg uint64)

func PacketLossDel

func PacketLossDel(labels Labels)

func PacketLossInc

func PacketLossInc(labels Labels, pkg int64)

func PacketLossTotalDel

func PacketLossTotalDel(labels Labels)

func PacketLossTotalInc

func PacketLossTotalInc(labels Labels, pkg int64)

func PliDel

func PliDel(labels Labels)

func PliInc

func PliInc(labels Labels, pli uint32)

func RecordTrackStats

func RecordTrackStats(labels Labels, statsRec *stats.Stats)

func RttDel

func RttDel(labels Labels)

func RttInc

func RttInc(labels Labels, rtt uint64)

func RunningLobbyDec

func RunningLobbyDec(stream string, lobby string)

func RunningLobbyInc

func RunningLobbyInc(stream string, lobby string)

func RunningSessionsDec

func RunningSessionsDec(lobby string)

func RunningSessionsDelete

func RunningSessionsDelete(lobby string)

func RunningSessionsInc

func RunningSessionsInc(lobby string)

func ServeMetrics

func ServeMetrics(ctx context.Context, config *MetricConfig) error

func ValidateMetricConfig

func ValidateMetricConfig(config *MetricConfig) error

Types

type GraphEdge

type GraphEdge struct {
	Id     string
	Source string
	Target string
	Stream string
}

type GraphNode

type GraphNode struct {
	Id         string
	Title      string
	Subtitle   string
	Stream     string // live stream
	Tracks     int
	MainTracks int
}

func BuildNode

func BuildNode(sessionId string, liveStreamId string, nodeType string) GraphNode

func GraphNodeUpdate

func GraphNodeUpdate(node GraphNode) GraphNode

func GraphNodeUpdateDec

func GraphNodeUpdateDec(node GraphNode, purpose string) GraphNode

func GraphNodeUpdateInc

func GraphNodeUpdateInc(node GraphNode, purpose string) GraphNode

type HttpMetric

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

func NewHttpMetric

func NewHttpMetric() (*HttpMetric, error)

type LabelType

type LabelType string
const (
	Session      LabelType = "session"
	Stream       LabelType = "stream"
	MediaStream  LabelType = "mediastream"
	TrackId      LabelType = "track"
	SSRC         LabelType = "ssrc"
	TrackKind    LabelType = "kind"      // values: video | audio
	TrackPurpose LabelType = "purpose"   // values: guest | main
	Direction    LabelType = "direction" // values: ingress | egress
)

type Labels

type Labels map[LabelType]string

type LobbyMetric

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

func NewLobbyMetrics

func NewLobbyMetrics() (*LobbyMetric, error)

type LobbySessionMetric

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

func NewLobbySessionMetrics

func NewLobbySessionMetrics() (*LobbySessionMetric, error)

type LobbySessionTrackMetric

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

func NewLobbySessionTrackMetrics

func NewLobbySessionTrackMetrics() (*LobbySessionTrackMetric, error)

type MetricConfig

type MetricConfig struct {
	Prometheus *PrometheusConfig `mapstructure:"prometheus"`
}

type NodeGraphMetric

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

func NewServiceGraphMetrics

func NewServiceGraphMetrics() (*NodeGraphMetric, error)

type PrometheusConfig

type PrometheusConfig struct {
	Enable   bool   `mapstructure:"enable"`
	Endpoint string `mapstructure:"endpoint"`
	Port     int    `mapstructure:"port"`
}

type TrackMetric

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

Jump to

Keyboard shortcuts

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