-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
collector.go
70 lines (53 loc) · 1.8 KB
/
collector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package ffmpeg
import (
"github.com/datarhei/core/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)
}