mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-03 11:22:37 +02:00
add receiverEstimatedMaximumBitrate.
This commit is contained in:
parent
3fda00bac5
commit
01b5d61e2b
4 changed files with 75 additions and 5 deletions
|
@ -21,6 +21,8 @@ type metrics struct {
|
|||
videoIds map[string]prometheus.Gauge
|
||||
videoIdsMu *sync.Mutex
|
||||
|
||||
receiverEstimatedMaximumBitrate prometheus.Gauge
|
||||
|
||||
iceBytesSent prometheus.Gauge
|
||||
iceBytesReceived prometheus.Gauge
|
||||
sctpBytesSent prometheus.Gauge
|
||||
|
@ -92,6 +94,16 @@ func (m *metricsCtx) getBySession(session types.Session) metrics {
|
|||
videoIds: map[string]prometheus.Gauge{},
|
||||
videoIdsMu: &sync.Mutex{},
|
||||
|
||||
receiverEstimatedMaximumBitrate: promauto.NewGauge(prometheus.GaugeOpts{
|
||||
Name: "receiver_estimated_maximum_bitrate",
|
||||
Namespace: "neko",
|
||||
Subsystem: "webrtc",
|
||||
Help: "Receiver Estimated Maximum Bitrate from SCTP.",
|
||||
ConstLabels: map[string]string{
|
||||
"session_id": session.ID(),
|
||||
},
|
||||
}),
|
||||
|
||||
iceBytesSent: promauto.NewGauge(prometheus.GaugeOpts{
|
||||
Name: "ice_bytes_sent",
|
||||
Namespace: "neko",
|
||||
|
@ -205,6 +217,12 @@ func (m *metricsCtx) SetVideoID(session types.Session, videoId string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *metricsCtx) SetReceiverEstimatedMaximumBitrate(session types.Session, bitrate float32) {
|
||||
met := m.getBySession(session)
|
||||
|
||||
met.receiverEstimatedMaximumBitrate.Set(float64(bitrate))
|
||||
}
|
||||
|
||||
func (m *metricsCtx) SetIceTransportStats(session types.Session, data webrtc.TransportStats) {
|
||||
met := m.getBySession(session)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue