mirror of
https://github.com/owncast/owncast.git
synced 2024-11-29 03:29:03 +03:00
769fc3a561
Co-authored-by: Michael Leow <mleow@moneylion.com>
15 lines
377 B
Go
15 lines
377 B
Go
package admin
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"github.com/owncast/owncast/metrics"
|
|
)
|
|
|
|
// GetViewersOverTime will return the number of viewers at points in time
|
|
func GetViewersOverTime(w http.ResponseWriter, r *http.Request) {
|
|
viewersOverTime := metrics.Metrics.Viewers
|
|
w.Header().Set("Content-Type", "application/json")
|
|
json.NewEncoder(w).Encode(viewersOverTime)
|
|
}
|