forked from johejo/sora_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from shiguredo/feature/sora-2024-2
Sora 2024.2 で追加予定の統計情報に対応する
- Loading branch information
Showing
13 changed files
with
353 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package collector | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
var ( | ||
sctpMetrics = SctpMetrics{ | ||
totalReceivedSctp: newDesc("sctp_received_packets_total", "The total number of received SCTP packets."), | ||
totalReceivedSctpByteSize: newDesc("sctp_received_bytes_total", "The total number of received SCTP bytes."), | ||
totalSentSctp: newDesc("sctp_sent_packets_total", "The total number of sent SCTP packets."), | ||
totalSentSctpByteSize: newDesc("sctp_sent_bytes_total", "The total number of sent SCTP bytes."), | ||
} | ||
) | ||
|
||
type SctpMetrics struct { | ||
totalReceivedSctp *prometheus.Desc | ||
totalReceivedSctpByteSize *prometheus.Desc | ||
totalSentSctp *prometheus.Desc | ||
totalSentSctpByteSize *prometheus.Desc | ||
} | ||
|
||
func (m *SctpMetrics) Describe(ch chan<- *prometheus.Desc) { | ||
ch <- m.totalReceivedSctp | ||
ch <- m.totalReceivedSctpByteSize | ||
ch <- m.totalSentSctp | ||
ch <- m.totalSentSctpByteSize | ||
} | ||
|
||
func (m *SctpMetrics) Collect(ch chan<- prometheus.Metric, report soraSctpReport) { | ||
ch <- newCounter(m.totalReceivedSctp, float64(report.TotalReceivedSctp)) | ||
ch <- newCounter(m.totalReceivedSctpByteSize, float64(report.TotalReceivedSctpByteSize)) | ||
ch <- newCounter(m.totalSentSctp, float64(report.TotalSentSctp)) | ||
ch <- newCounter(m.totalSentSctpByteSize, float64(report.TotalSentSctpByteSize)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package collector | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
var ( | ||
srtpMetrics = SrtpMetrics{ | ||
totalReceivedSrtp: newDesc("srtp_received_packets_total", "The total number of received SRTP packets."), | ||
totalReceivedSrtpByteSize: newDesc("srtp_received_bytes_total", "The total number of received SRTP bytes."), | ||
totalSentSrtp: newDesc("srtp_sent_packets_total", "The total number of sent SRTP packets."), | ||
totalSentSrtpByteSize: newDesc("srtp_sent_bytes_total", "The total number of sent SRTP bytes."), | ||
totalDecryptedSrtp: newDesc("srtp_decrypted_packets_total", "The total number of decrpyted SRTP packets."), | ||
totalDecryptedSrtpByteSize: newDesc("srtp_decrpyted_bytes_total", "The total number of decrypted SRTP bytes."), | ||
} | ||
) | ||
|
||
type SrtpMetrics struct { | ||
totalReceivedSrtp *prometheus.Desc | ||
totalReceivedSrtpByteSize *prometheus.Desc | ||
totalSentSrtp *prometheus.Desc | ||
totalSentSrtpByteSize *prometheus.Desc | ||
totalDecryptedSrtp *prometheus.Desc | ||
totalDecryptedSrtpByteSize *prometheus.Desc | ||
} | ||
|
||
func (m *SrtpMetrics) Describe(ch chan<- *prometheus.Desc) { | ||
ch <- m.totalReceivedSrtp | ||
ch <- m.totalReceivedSrtpByteSize | ||
ch <- m.totalSentSrtp | ||
ch <- m.totalSentSrtpByteSize | ||
ch <- m.totalDecryptedSrtp | ||
ch <- m.totalDecryptedSrtpByteSize | ||
} | ||
|
||
func (m *SrtpMetrics) Collect(ch chan<- prometheus.Metric, report soraSrtpReport) { | ||
ch <- newCounter(m.totalReceivedSrtp, float64(report.TotalReceivedSrtp)) | ||
ch <- newCounter(m.totalReceivedSrtpByteSize, float64(report.TotalReceivedSrtpByteSize)) | ||
ch <- newCounter(m.totalSentSrtp, float64(report.TotalSentSrtp)) | ||
ch <- newCounter(m.totalSentSrtpByteSize, float64(report.TotalSentSrtpByteSize)) | ||
ch <- newCounter(m.totalDecryptedSrtp, float64(report.TotalDecryptedSrtp)) | ||
ch <- newCounter(m.totalDecryptedSrtpByteSize, float64(report.TotalDecryptedSrtpByteSize)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.