# PV vs Metrics for benchmarking

**URL:** <https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085>\
**Category:** Logstash\
**Created:** [December 29, 2015, 4:39am UTC](https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085 "2015-12-29T04:39:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johntdyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johntdyer/32/3424_2.png) [@Johntdyer](https://discuss.elastic.co/u/Johntdyer)\
**Post date:** [December 29, 2015, 4:39am UTC](https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085/1 "2015-12-29T04:39:21Z")

</div>

Hello,

I am trying to load test my grok patterns and I am confused on the output of `metrics{}` vs using `codec=> dots` along with **pv -War \> /dev/null**.

I am consuming the same 400,000 log lines as my **input** so that should be consistent and my output is as follows:

```
output{

  stdout {
    codec => dots
  }

  if "metrics" in [tags] {
    file {
      path => "/Users/jdyer/Projects/logstash/metics-%{+YYYY-MM-dd}.txt"
    }
  }
}

```

and when I run this I average \*\* [6.29KiB/s]\*\* according to PV, which AFAIK means I am getting ~6000 events per second however metrics-2015-12-29 says I am getting much lower

```
{"@version":"1","@timestamp":"2015-12-29T04:30:00.328Z","message":"0.0.0.0","logstash_event":{"count":37,"rate_1m":0.0,"rate_5m":0.0,"rate_15m":0.0},"tags":["metrics"]}
{"@version":"1","@timestamp":"2015-12-29T04:30:05.293Z","message":"0.0.0.0","logstash_event":{"count":17267,"rate_1m":3452.2,"rate_5m":3452.2,"rate_15m":3452.2},"tags":["metrics"]}
{"@version":"1","@timestamp":"2015-12-29T04:30:10.289Z","message":"0.0.0.0","logstash_event":{"count":48634,"rate_1m":3452.2,"rate_5m":3452.2,"rate_15m":3452.2},"tags":["metrics"]}
{"@version":"1","@timestamp":"2015-12-29T04:30:15.289Z","message":"0.0.0.0","logstash_event":{"count":85654,"rate_1m":3678.0105642038648,"rate_5m":3498.8799201169877,"rate_15m":3467.8464972645706},"tags":["metrics"]}
{"@version":"1","@timestamp":"2015-12-29T04:30:20.288Z","message":"0.0.0.0","logstash_event":{"count":121775,"rate_1m":3975.988195096199,"rate_5m":3563.4391005264056,"rate_15m":3489.657818067379},"tags":["metrics"]}

```

You can see in those logs that the 1m rate is between 3400 and 3900 events per minute ( 56 to 65 events / second ).

Any idea whats up w/ the disparity, am I maybe misunderstanding how to benchmark my logstash config ?

Thanks !

-John

---

<div class="post-metadata">

**Author:** ![Johntdyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johntdyer/32/3424_2.png) [@Johntdyer](https://discuss.elastic.co/u/Johntdyer)\
**Post date:** [January 4, 2016, 1:16am UTC](https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085/2 "2016-01-04T01:16:58Z")

</div>

Anyone have any thoughts on this ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 4, 2016, 7:42am UTC](https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085/3 "2016-01-04T07:42:35Z")

</div>

I believe the rate metrics shown is the average number of events per second averaged over a certain time period, not the number of events over that time period. Having said that this does seem low given the total count provided and the frequency with which the events are generated (This seems to indicate closer to 6000 events per second as you suggest). What does your metrics filter configuration look like?

---

<div class="post-metadata">

**Author:** ![Johntdyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johntdyer/32/3424_2.png) [@Johntdyer](https://discuss.elastic.co/u/Johntdyer)\
**Post date:** [January 4, 2016, 5:21pm UTC](https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085/4 "2016-01-04T17:21:24Z")

</div>

Thanks for responding, and happy new years !

So here is my metrics config, it's pretty straight forward

```auto
filter {
  metrics {
    meter => "logstash_event"
    rates => [1,5,15]
    clear_interval => -1
    add_tag => "metrics"
  }
}

```

---

<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:** [July 6, 2017, 5:16am UTC](https://discuss.elastic.co/t/pv-vs-metrics-for-benchmarking/38085/5 "2017-07-06T05:16:54Z")

</div>

Closed on July 6, 2017, 5:16am UTC


