mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-02 00:11:56 +03:00
Rework stats
This commit is contained in:
+26
-2
@@ -15,6 +15,10 @@ func (e EventStart) StreamID() string {
|
||||
return e.ConnID
|
||||
}
|
||||
|
||||
func (e EventStart) Timestamp() time.Time {
|
||||
return e.CreatedAt
|
||||
}
|
||||
|
||||
type EventConnectedToDC struct {
|
||||
CreatedAt time.Time
|
||||
ConnID string
|
||||
@@ -26,17 +30,25 @@ func (e EventConnectedToDC) StreamID() string {
|
||||
return e.ConnID
|
||||
}
|
||||
|
||||
type EventTraffic struct {
|
||||
func (e EventConnectedToDC) Timestamp() time.Time {
|
||||
return e.CreatedAt
|
||||
}
|
||||
|
||||
type EventTelegramTraffic struct {
|
||||
CreatedAt time.Time
|
||||
ConnID string
|
||||
Traffic uint
|
||||
IsRead bool
|
||||
}
|
||||
|
||||
func (e EventTraffic) StreamID() string {
|
||||
func (e EventTelegramTraffic) StreamID() string {
|
||||
return e.ConnID
|
||||
}
|
||||
|
||||
func (e EventTelegramTraffic) Timestamp() time.Time {
|
||||
return e.CreatedAt
|
||||
}
|
||||
|
||||
type EventFinish struct {
|
||||
CreatedAt time.Time
|
||||
ConnID string
|
||||
@@ -46,6 +58,10 @@ func (e EventFinish) StreamID() string {
|
||||
return e.ConnID
|
||||
}
|
||||
|
||||
func (e EventFinish) Timestamp() time.Time {
|
||||
return e.CreatedAt
|
||||
}
|
||||
|
||||
type EventConcurrencyLimited struct {
|
||||
CreatedAt time.Time
|
||||
}
|
||||
@@ -54,6 +70,10 @@ func (e EventConcurrencyLimited) StreamID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (e EventConcurrencyLimited) Timestamp() time.Time {
|
||||
return e.CreatedAt
|
||||
}
|
||||
|
||||
type EventIPBlocklisted struct {
|
||||
CreatedAt time.Time
|
||||
RemoteIP net.IP
|
||||
@@ -62,3 +82,7 @@ type EventIPBlocklisted struct {
|
||||
func (e EventIPBlocklisted) StreamID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (e EventIPBlocklisted) Timestamp() time.Time {
|
||||
return e.CreatedAt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user