diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index 95e05577..02b15ae8 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -80,10 +80,10 @@ func (m *Metrics) onMetrics(w http.ResponseWriter, req *http.Request) { countClients := atomic.LoadInt64(m.stats.CountClients) countPublishers := atomic.LoadInt64(m.stats.CountPublishers) countReaders := atomic.LoadInt64(m.stats.CountReaders) - countSourcesRtsp := atomic.LoadInt64(m.stats.CountSourcesRtsp) - countSourcesRtspRunning := atomic.LoadInt64(m.stats.CountSourcesRtspRunning) - countSourcesRtmp := atomic.LoadInt64(m.stats.CountSourcesRtmp) - countSourcesRtmpRunning := atomic.LoadInt64(m.stats.CountSourcesRtmpRunning) + countSourcesRTSP := atomic.LoadInt64(m.stats.CountSourcesRTSP) + countSourcesRTSPRunning := atomic.LoadInt64(m.stats.CountSourcesRTSPRunning) + countSourcesRTMP := atomic.LoadInt64(m.stats.CountSourcesRTMP) + countSourcesRTMPRunning := atomic.LoadInt64(m.stats.CountSourcesRTMPRunning) out := "" out += formatMetric("rtsp_clients{state=\"idle\"}", @@ -93,13 +93,13 @@ func (m *Metrics) onMetrics(w http.ResponseWriter, req *http.Request) { out += formatMetric("rtsp_clients{state=\"reading\"}", countReaders, nowUnix) out += formatMetric("rtsp_sources{type=\"rtsp\",state=\"idle\"}", - countSourcesRtsp-countSourcesRtspRunning, nowUnix) + countSourcesRTSP-countSourcesRTSPRunning, nowUnix) out += formatMetric("rtsp_sources{type=\"rtsp\",state=\"running\"}", - countSourcesRtspRunning, nowUnix) + countSourcesRTSPRunning, nowUnix) out += formatMetric("rtsp_sources{type=\"rtmp\",state=\"idle\"}", - countSourcesRtmp-countSourcesRtmpRunning, nowUnix) + countSourcesRTMP-countSourcesRTMPRunning, nowUnix) out += formatMetric("rtsp_sources{type=\"rtmp\",state=\"running\"}", - countSourcesRtmpRunning, nowUnix) + countSourcesRTMPRunning, nowUnix) w.WriteHeader(http.StatusOK) io.WriteString(w, out) diff --git a/internal/sourcertmp/source.go b/internal/sourcertmp/source.go index fbae4fa9..f87f72d9 100644 --- a/internal/sourcertmp/source.go +++ b/internal/sourcertmp/source.go @@ -61,7 +61,7 @@ func New(ur string, terminate: make(chan struct{}), } - atomic.AddInt64(s.stats.CountSourcesRtmp, +1) + atomic.AddInt64(s.stats.CountSourcesRTMP, +1) s.log(logger.Info, "started") s.wg.Add(1) @@ -71,7 +71,7 @@ func New(ur string, // Close closes a Source. func (s *Source) Close() { - atomic.AddInt64(s.stats.CountSourcesRtmpRunning, -1) + atomic.AddInt64(s.stats.CountSourcesRTMPRunning, -1) s.log(logger.Info, "stopped") close(s.terminate) } diff --git a/internal/sourcertsp/source.go b/internal/sourcertsp/source.go index 742590a6..4c38a481 100644 --- a/internal/sourcertsp/source.go +++ b/internal/sourcertsp/source.go @@ -72,7 +72,7 @@ func New( terminate: make(chan struct{}), } - atomic.AddInt64(s.stats.CountSourcesRtsp, +1) + atomic.AddInt64(s.stats.CountSourcesRTSP, +1) s.log(logger.Info, "started") s.wg.Add(1) @@ -82,7 +82,7 @@ func New( // Close closes a Source. func (s *Source) Close() { - atomic.AddInt64(s.stats.CountSourcesRtsp, -1) + atomic.AddInt64(s.stats.CountSourcesRTSP, -1) s.log(logger.Info, "stopped") close(s.terminate) } diff --git a/internal/stats/stats.go b/internal/stats/stats.go index 2f231e4c..b4369bcd 100644 --- a/internal/stats/stats.go +++ b/internal/stats/stats.go @@ -12,10 +12,10 @@ type Stats struct { CountClients *int64 CountPublishers *int64 CountReaders *int64 - CountSourcesRtsp *int64 - CountSourcesRtspRunning *int64 - CountSourcesRtmp *int64 - CountSourcesRtmpRunning *int64 + CountSourcesRTSP *int64 + CountSourcesRTSPRunning *int64 + CountSourcesRTMP *int64 + CountSourcesRTMPRunning *int64 } // New allocates a Stats. @@ -24,10 +24,10 @@ func New() *Stats { CountClients: ptrInt64(), CountPublishers: ptrInt64(), CountReaders: ptrInt64(), - CountSourcesRtsp: ptrInt64(), - CountSourcesRtspRunning: ptrInt64(), - CountSourcesRtmp: ptrInt64(), - CountSourcesRtmpRunning: ptrInt64(), + CountSourcesRTSP: ptrInt64(), + CountSourcesRTSPRunning: ptrInt64(), + CountSourcesRTMP: ptrInt64(), + CountSourcesRTMPRunning: ptrInt64(), } }