mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
proxy: add country to prometheus metrics
This commit is contained in:
parent
b3c734ed63
commit
e345c3bac9
6 changed files with 45 additions and 13 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
type EventCollector interface {
|
||||
TrackInBoundTraffic(value int64)
|
||||
TrackOutBoundTraffic(value int64)
|
||||
TrackNewConnection()
|
||||
TrackNewConnection(country string)
|
||||
}
|
||||
|
||||
type EventMetrics struct {
|
||||
|
@ -25,6 +25,7 @@ func (em *EventMetrics) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
|
|||
em.collector.TrackInBoundTraffic(e.InboundBytes)
|
||||
em.collector.TrackOutBoundTraffic(e.OutboundBytes)
|
||||
case event.EventOnProxyConnectionOver:
|
||||
em.collector.TrackNewConnection()
|
||||
e := e.(event.EventOnProxyConnectionOver)
|
||||
em.collector.TrackNewConnection(e.Country)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue