Add new stats metric

This commit is contained in:
9seconds
2019-10-08 11:55:57 +03:00
parent d44474012a
commit 6c7edfb7db
21 changed files with 477 additions and 510 deletions
+21
View File
@@ -0,0 +1,21 @@
package wrappers
import (
"net"
"github.com/9seconds/mtg/conntypes"
)
func NewClientConn(parent net.Conn, connID conntypes.ConnID) conntypes.StreamReadWriteCloser {
conn := newConn(parent, connID, connPurposeClient)
conn = NewTrafficStats(conn)
return conn
}
func NewTelegramConn(dc conntypes.DC, parent net.Conn) conntypes.StreamReadWriteCloser {
conn := newConn(parent, conntypes.ConnID{}, connPurposeTelegram)
conn = NewTelegramStats(dc, conn)
return conn
}