1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-27 06:38:44 +02:00

WebRTC session exchange working

This commit is contained in:
Alexandre Iooss
2020-09-24 11:24:13 +02:00
parent 02399e7e26
commit 097766141f
6 changed files with 278 additions and 46 deletions

View File

@ -15,15 +15,21 @@ type Options struct {
}
var (
// ViewerServed is the total amount of viewer page served
ViewerServed = promauto.NewCounter(prometheus.CounterOpts{
Name: "ghostream_viewer_served_total",
// WebViewerServed is the total amount of viewer page served
WebViewerServed = promauto.NewCounter(prometheus.CounterOpts{
Name: "ghostream_web_viewer_served_total",
Help: "The total amount of viewer served",
})
// WebSessions is the total amount of WebRTC session exchange
WebSessions = promauto.NewCounter(prometheus.CounterOpts{
Name: "ghostream_web_sessions_total",
Help: "The total amount of WebRTC sessions exchanged",
})
)
// ServeHTTP server that expose prometheus metrics
func ServeHTTP(cfg *Options) {
// Serve monitoring server that expose prometheus metrics
func Serve(cfg *Options) {
mux := http.NewServeMux()
mux.Handle("/metrics", promhttp.Handler())
log.Printf("Monitoring HTTP server listening on %s", cfg.ListenAddress)