2020-10-02 22:18:08 +03:00
|
|
|
package admin
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"net/http"
|
|
|
|
|
2020-10-05 20:07:09 +03:00
|
|
|
"github.com/owncast/owncast/metrics"
|
2020-11-15 05:39:53 +03:00
|
|
|
log "github.com/sirupsen/logrus"
|
2020-10-02 22:18:08 +03:00
|
|
|
)
|
|
|
|
|
2020-11-13 02:14:59 +03:00
|
|
|
// GetHardwareStats will return hardware utilization over time.
|
2020-10-02 22:18:08 +03:00
|
|
|
func GetHardwareStats(w http.ResponseWriter, r *http.Request) {
|
2020-10-17 01:04:31 +03:00
|
|
|
m := metrics.Metrics
|
2020-10-02 22:18:08 +03:00
|
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
2020-11-15 05:39:53 +03:00
|
|
|
err := json.NewEncoder(w).Encode(m)
|
|
|
|
if err != nil {
|
|
|
|
log.Errorln(err)
|
|
|
|
}
|
2020-10-02 22:18:08 +03:00
|
|
|
}
|