mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Update prometheus metrics to use new EventOnProxyStats
This commit is contained in:
parent
caa2b36463
commit
22d9381d9d
2 changed files with 5 additions and 4 deletions
|
@ -46,7 +46,7 @@ func (p *periodicProxyStats) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
|
|||
|
||||
func (p *periodicProxyStats) logTick() error {
|
||||
inboundSum, outboundSum := p.bytesLogger.GetStat()
|
||||
e := &event.EventOnProxyStats{
|
||||
e := event.EventOnProxyStats{
|
||||
SummaryInterval: p.logPeriod,
|
||||
ConnectionCount: p.connectionCount,
|
||||
}
|
||||
|
|
|
@ -20,10 +20,11 @@ func NewEventMetrics(collector EventCollector) *EventMetrics {
|
|||
|
||||
func (em *EventMetrics) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
|
||||
switch e.(type) {
|
||||
case event.EventOnProxyStats:
|
||||
e := e.(event.EventOnProxyStats)
|
||||
em.collector.TrackInBoundTraffic(e.InboundBytes)
|
||||
em.collector.TrackOutBoundTraffic(e.OutboundBytes)
|
||||
case event.EventOnProxyConnectionOver:
|
||||
e := e.(event.EventOnProxyConnectionOver)
|
||||
em.collector.TrackInBoundTraffic(e.InboundTraffic)
|
||||
em.collector.TrackOutBoundTraffic(e.OutboundTraffic)
|
||||
em.collector.TrackNewConnection()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue