Add prometheus

This commit is contained in:
9seconds
2021-03-17 12:01:28 +03:00
parent 8e7207d975
commit dbbfdaf918
8 changed files with 627 additions and 23 deletions
+19
View File
@@ -0,0 +1,19 @@
package stats
import (
"net"
"time"
)
type streamInfo struct {
createdAt time.Time
clientIP net.IP
}
func (s *streamInfo) IPType() string {
if s.clientIP.To4() == nil {
return TagIPTypeIPv6
}
return TagIPTypeIPv4
}