You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
458 B
19 lines
458 B
package admin |
|
|
|
import ( |
|
"encoding/json" |
|
"net/http" |
|
|
|
"github.com/owncast/owncast/metrics" |
|
log "github.com/sirupsen/logrus" |
|
) |
|
|
|
// 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") |
|
err := json.NewEncoder(w).Encode(viewersOverTime) |
|
if err != nil { |
|
log.Errorln(err) |
|
} |
|
}
|
|
|