# Calculating EPS? events.filtered / duration\_in\_millis is incorrect

**URL:** <https://discuss.elastic.co/t/calculating-eps-events-filtered-duration-in-millis-is-incorrect/286936>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [October 17, 2021, 6:20pm UTC](https://discuss.elastic.co/t/calculating-eps-events-filtered-duration-in-millis-is-incorrect/286936 "2021-10-17T18:20:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CamTheMan](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@CamTheMan](https://discuss.elastic.co/u/CamTheMan)\
**Post date:** [October 17, 2021, 6:20pm UTC](https://discuss.elastic.co/t/calculating-eps-events-filtered-duration-in-millis-is-incorrect/286936/1 "2021-10-17T18:20:12Z")

</div>

Hello All,  
I would like to calculate my events per second for logstash.  
Currently I'm grabbing data via the logstash API but when I calculate the EPS it doesn't match up to what the 'metrics' logstash filter is reporting. (I had to use metrics due to this issue and said EPS).

```auto
{
  "out": 369050,
  "queue_push_duration_in_millis": 1566096,
  "filtered": 369050,
  "in": 377057,
  "duration_in_millis": 5541992
}

```

Using the above data from the API (`.pipelines.dev.events`) I would calculate EPS as `$out / ($duration_in_millis / 1000)` = `66.5`

Now the only way this can be correct is if `66.5` needs to be multiplied by pipeline.workers.

**Is that correct? Or have I gone way off tact here?**

---

<div class="post-metadata">

**Author:** ![CamTheMan](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@CamTheMan](https://discuss.elastic.co/u/CamTheMan)\
**Post date:** [October 18, 2021, 3:10pm UTC](https://discuss.elastic.co/t/calculating-eps-events-filtered-duration-in-millis-is-incorrect/286936/2 "2021-10-18T15:10:01Z")

</div>

My testing shows that it must need to be multiplied by worker\_count.

Annoyingly the longer the pipeline is up the more "averaged" the statistic becomes... Any workarounds in regards to that?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 15, 2021, 3:10pm UTC](https://discuss.elastic.co/t/calculating-eps-events-filtered-duration-in-millis-is-incorrect/286936/3 "2021-11-15T15:10:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
