mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 22:34:02 +03:00
Add EventReplayAttack
This commit is contained in:
@@ -198,6 +198,19 @@ func (suite *PrometheusTestSuite) TestEventIPBlocklisted() {
|
||||
suite.Contains(data, `mtg_ip_blocklisted 1`)
|
||||
}
|
||||
|
||||
func (suite *PrometheusTestSuite) TestEventReplayAttack() {
|
||||
suite.prometheus.EventReplayAttack(mtglib.EventReplayAttack{
|
||||
CreatedAt: time.Now(),
|
||||
ConnID: "connID",
|
||||
})
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
data, err := suite.Get()
|
||||
suite.NoError(err)
|
||||
suite.Contains(data, `mtg_replay_attacks 1`)
|
||||
}
|
||||
|
||||
func TestPrometheus(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, &PrometheusTestSuite{})
|
||||
|
||||
Reference in New Issue
Block a user