prom

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const STREAM_URL = "api/v1/streams"
View Source
const SUMMARY_URL = "api/v1/summaries"

Variables

This section is empty.

Functions

func GetHttpHandler

func GetHttpHandler() gin.HandlerFunc

func InitMetrics

func InitMetrics(srsConfig *yml.SrsConfig)

初始化 promClient

Types

type PromClient

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

type SelfStatus

type SelfStatus struct {
	MemPercent float64 `json:"mem_percent"`
	CpuPercent float64 `json:"cpu_percent"`
}

type StreamResponse

type StreamResponse struct {
	Code    int16          `json:"code"`
	Server  string         `json:"server"`
	Streams []StreamStatus `json:"streams"`
}

type StreamStatus

type StreamStatus struct {
	Clients   uint32 `json:"clients"`
	Frames    uint32 `json:"frames"`
	SendBytes uint32 `json:"send_bytes"`
	RecvBytes uint32 `json:"recv_bytes"`
	LiveMs    uint64 `json:"live_ms"`
	Id        string `json:"id"`
	Name      string `json:"name"`
	Vhost     string `json:"vhost"`
	App       string `json:"app"`
}

type SummaryData

type SummaryData struct {
	Ok    bool       `json:"ok"`
	NowMs uint64     `json:"now_ms"`
	Self  SelfStatus `json:"self"`
}

type SummaryResponse

type SummaryResponse struct {
	Code   int16       `json:"code"`
	Server string      `json:"server"`
	Data   SummaryData `json:"data"`
}

Jump to

Keyboard shortcuts

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