Documentation
¶
Index ¶
- Variables
- type Bucket
- type History
- type Series
- type Server
- func (s *Server) ListenAndServe(ctx context.Context) error
- func (s *Server) RTTSubscriber() func(userID string, rtt time.Duration)
- func (s *Server) Record(start time.Time, thresholds Thresholds)
- func (s *Server) Run(ctx context.Context)
- func (s *Server) Series() Series
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Snapshot() Snapshot
- func (s *Server) Subscribe() *Subscriber
- func (s *Server) Subscriber() func(vp9_stats.Period, vp9_stats.VideoQualitySample)
- func (s *Server) Tick(now time.Time)
- func (s *Server) Unsubscribe(sub *Subscriber)
- type Snapshot
- type Subscriber
- type Thresholds
- type Update
- type Viewers
Constants ¶
This section is empty.
Variables ¶
var HistoryFields = []string{"bitrate", "fps"}
var SeriesFields = []string{
"t", "viewers", "active", "bitrate",
"fps_p10", "fps_p50", "fps_p90", "dec_fps_p50",
"jitter_p50", "jitter_p90",
"frames_complete", "frames_lost", "pli", "errors",
"below", "rtt_p50", "rtt_p90", "layers_s0", "layers_s1", "layers_s2",
}
var ViewerFields = []string{
"bitrate", "fps", "dec_fps", "buf_fps", "est_dec_fps", "jitter",
"frames_complete", "frames_lost", "pli", "sid", "tid", "samples", "seen",
"rtt",
}
Functions ¶
This section is empty.
Types ¶
type Series ¶ added in v0.17.7
type Series struct {
Start int64 `json:"start"`
Interval int64 `json:"interval"`
Fields []string `json:"fields"`
Points [][]float64 `json:"points"`
Thresholds *Thresholds `json:"thresholds,omitempty"`
}
func (Series) Downsample ¶ added in v0.17.7
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a lightweight HTTP metrics server that tracks per-viewer stats.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server and blocks until ctx is cancelled.
func (*Server) RTTSubscriber ¶ added in v0.17.7
func (*Server) Record ¶ added in v0.17.7
func (s *Server) Record(start time.Time, thresholds Thresholds)
func (*Server) ServeHTTP ¶ added in v0.17.0
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Server) Subscribe ¶ added in v0.17.7
func (s *Server) Subscribe() *Subscriber
func (*Server) Subscriber ¶
func (s *Server) Subscriber() func(vp9_stats.Period, vp9_stats.VideoQualitySample)
Subscriber returns a func compatible with vp9_stats.Publisher.AddSubscriber.
func (*Server) Unsubscribe ¶ added in v0.17.7
func (s *Server) Unsubscribe(sub *Subscriber)
type Subscriber ¶ added in v0.17.7
type Subscriber struct {
// contains filtered or unexported fields
}
func (*Subscriber) Updates ¶ added in v0.17.7
func (sub *Subscriber) Updates() <-chan Update
type Thresholds ¶ added in v0.17.7
type Update ¶ added in v0.17.7
type Update struct {
Point []float64 `json:"p,omitempty"`
Rows [][]float64 `json:"v,omitempty"`
Names []string `json:"n,omitempty"`
Buckets []Bucket `json:"b,omitempty"`
Errors map[string]int32 `json:"e,omitempty"`
Series *Series `json:"series,omitempty"`
Viewers *Viewers `json:"viewers,omitempty"`
}