Rework stats

This commit is contained in:
9seconds
2021-03-27 22:04:30 +03:00
parent 5eca6ecb05
commit bc2bd4510a
19 changed files with 273 additions and 232 deletions
+26 -2
View File
@@ -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
}