mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00

Commits (Ingo Oppermann): - Add experimental SRT connection stats and logs - Hide /config/reload endpoint in reade-only mode - Add SRT server - Create v16 in go.mod - Fix data races, tests, lint, and update dependencies - Add trailing slash for routed directories (datarhei/restreamer#340) - Allow relative URLs in content in static routes Co-Authored-By: Ingo Oppermann <57445+ioppermann@users.noreply.github.com>
71 lines
1.8 KiB
Go
71 lines
1.8 KiB
Go
package ffmpeg
|
|
|
|
import (
|
|
"github.com/datarhei/core/v16/session"
|
|
)
|
|
|
|
type wrappedCollector struct {
|
|
session.Collector
|
|
|
|
prefix string
|
|
reference string
|
|
}
|
|
|
|
func NewWrappedCollector(prefix, reference string, collector session.Collector) session.Collector {
|
|
w := &wrappedCollector{
|
|
prefix: prefix,
|
|
reference: reference,
|
|
Collector: collector,
|
|
}
|
|
|
|
return w
|
|
}
|
|
|
|
func (w *wrappedCollector) Register(id, reference, location, peer string) {
|
|
w.Collector.Register(w.prefix+id, w.reference, location, peer)
|
|
}
|
|
|
|
func (w *wrappedCollector) Activate(id string) bool {
|
|
return w.Collector.Activate(w.prefix + id)
|
|
}
|
|
|
|
func (w *wrappedCollector) RegisterAndActivate(id, reference, location, peer string) {
|
|
w.Collector.RegisterAndActivate(w.prefix+id, w.reference, location, peer)
|
|
}
|
|
|
|
func (w *wrappedCollector) Extra(id, extra string) {
|
|
w.Collector.Extra(w.prefix+id, extra)
|
|
}
|
|
|
|
func (w *wrappedCollector) Unregister(id string) {
|
|
w.Collector.Unregister(w.prefix + id)
|
|
}
|
|
|
|
func (w *wrappedCollector) Ingress(id string, size int64) {
|
|
w.Collector.Ingress(w.prefix+id, size)
|
|
}
|
|
|
|
func (w *wrappedCollector) Egress(id string, size int64) {
|
|
w.Collector.Egress(w.prefix+id, size)
|
|
}
|
|
|
|
func (w *wrappedCollector) IsKnownSession(id string) bool {
|
|
return w.Collector.IsKnownSession(w.prefix + id)
|
|
}
|
|
|
|
func (w *wrappedCollector) SessionTopIngressBitrate(id string) float64 {
|
|
return w.Collector.SessionTopIngressBitrate(w.prefix + id)
|
|
}
|
|
|
|
func (w *wrappedCollector) SessionTopEgressBitrate(id string) float64 {
|
|
return w.Collector.SessionTopEgressBitrate(w.prefix + id)
|
|
}
|
|
|
|
func (w *wrappedCollector) SessionSetTopIngressBitrate(id string, bitrate float64) {
|
|
w.Collector.SessionSetTopIngressBitrate(w.prefix+id, bitrate)
|
|
}
|
|
|
|
func (w *wrappedCollector) SessionSetTopEgressBitrate(id string, bitrate float64) {
|
|
w.Collector.SessionSetTopEgressBitrate(w.prefix+id, bitrate)
|
|
}
|