mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-22 13:37:11 +02:00
add passive estimator & REMB back. (#35)
This commit is contained in:
parent
0de8ffc773
commit
9936a04fea
4 changed files with 41 additions and 11 deletions
|
@ -27,6 +27,7 @@ type metrics struct {
|
|||
videoIdsMu *sync.Mutex
|
||||
|
||||
receiverEstimatedMaximumBitrate prometheus.Gauge
|
||||
receiverEstimatedTargetBitrate prometheus.Gauge
|
||||
|
||||
receiverReportDelay prometheus.Gauge
|
||||
receiverReportJitter prometheus.Gauge
|
||||
|
@ -144,6 +145,15 @@ func (m *metricsCtx) getBySession(session types.Session) metrics {
|
|||
"session_id": session.ID(),
|
||||
},
|
||||
}),
|
||||
receiverEstimatedTargetBitrate: promauto.NewGauge(prometheus.GaugeOpts{
|
||||
Name: "receiver_estimated_target_bitrate",
|
||||
Namespace: "neko",
|
||||
Subsystem: "webrtc",
|
||||
Help: "Receiver Estimated Target Bitrate using Google's congestion control.",
|
||||
ConstLabels: map[string]string{
|
||||
"session_id": session.ID(),
|
||||
},
|
||||
}),
|
||||
|
||||
receiverReportDelay: promauto.NewGauge(prometheus.GaugeOpts{
|
||||
Name: "receiver_report_delay",
|
||||
|
@ -327,10 +337,16 @@ func (m *metricsCtx) SetVideoID(session types.Session, videoId string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *metricsCtx) SetReceiverEstimatedMaximumBitrate(session types.Session, bitrate float64) {
|
||||
func (m *metricsCtx) SetReceiverEstimatedMaximumBitrate(session types.Session, bitrate float32) {
|
||||
met := m.getBySession(session)
|
||||
|
||||
met.receiverEstimatedMaximumBitrate.Set(bitrate)
|
||||
met.receiverEstimatedMaximumBitrate.Set(float64(bitrate))
|
||||
}
|
||||
|
||||
func (m *metricsCtx) SetReceiverEstimatedTargetBitrate(session types.Session, bitrate float64) {
|
||||
met := m.getBySession(session)
|
||||
|
||||
met.receiverEstimatedTargetBitrate.Set(bitrate)
|
||||
}
|
||||
|
||||
func (m *metricsCtx) SetReceiverReport(session types.Session, report rtcp.ReceptionReport) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue