mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
fix double push of metrics by properly handling tickers (#2374)
This commit is contained in:
parent
7106d396dc
commit
395cace69f
2 changed files with 11 additions and 8 deletions
|
@ -26,15 +26,15 @@ func TestAPICSendMetrics(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
name: "basic",
|
||||
duration: time.Millisecond * 30,
|
||||
metricsInterval: time.Millisecond * 5,
|
||||
duration: time.Millisecond * 60,
|
||||
metricsInterval: time.Millisecond * 10,
|
||||
expectedCalls: 5,
|
||||
setUp: func(api *apic) {},
|
||||
},
|
||||
{
|
||||
name: "with some metrics",
|
||||
duration: time.Millisecond * 30,
|
||||
metricsInterval: time.Millisecond * 5,
|
||||
duration: time.Millisecond * 60,
|
||||
metricsInterval: time.Millisecond * 10,
|
||||
expectedCalls: 5,
|
||||
setUp: func(api *apic) {
|
||||
api.dbClient.Ent.Machine.Delete().ExecX(context.Background())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue