Skip to content

Commit

Permalink
count discarded requests and responses in metrics
Browse files Browse the repository at this point in the history
commit_hash:73e2c75380e290fe280175199aa1e8478e7d2386
  • Loading branch information
Digrinch committed Sep 12, 2024
1 parent ee3f6ba commit 5fb667d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/engine/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ func (i *instance) Run(ctx context.Context) (recoverErr error) {
if !waiter.Wait(ctx) {
return nil
}
i.metrics.Request.Add(1)
if !i.discardOverflow || !waiter.IsSlowDown(ctx) {
i.metrics.Request.Add(1)
i.metrics.BusyInstances.OnStart(i.id)
defer i.metrics.BusyInstances.OnFinish(i.id)
if tag.Debug {
i.log.Debug("Shooting", zap.Any("ammo", ammo))
}
i.gun.Shoot(ammo)
i.metrics.Response.Add(1)
} else {
i.aggregator.Report(netsample.DiscardedShootSample())
}
i.metrics.Response.Add(1)
return nil
}()
if err != nil {
Expand Down

0 comments on commit 5fb667d

Please sign in to comment.