mediamtx/internal/stats/stats.go

33 lines
784 B
Go
Raw Normal View History

2020-10-19 20:17:48 +00:00
package stats
func ptrInt64() *int64 {
v := int64(0)
return &v
}
2020-11-05 11:30:25 +00:00
// Stats contains statistics.
2020-10-19 20:17:48 +00:00
type Stats struct {
// use pointers to avoid a crash on 32bit platforms
// https://github.com/golang/go/issues/9959
CountClients *int64
CountPublishers *int64
CountReaders *int64
CountSourcesRtsp *int64
CountSourcesRtspRunning *int64
CountSourcesRtmp *int64
CountSourcesRtmpRunning *int64
}
2020-11-05 11:30:25 +00:00
// New allocates a Stats.
2020-10-19 20:17:48 +00:00
func New() *Stats {
return &Stats{
CountClients: ptrInt64(),
CountPublishers: ptrInt64(),
CountReaders: ptrInt64(),
CountSourcesRtsp: ptrInt64(),
CountSourcesRtspRunning: ptrInt64(),
CountSourcesRtmp: ptrInt64(),
CountSourcesRtmpRunning: ptrInt64(),
}
}