# Number of queries with response time slower than 3ms using pt-query-digest

**URL:** <https://forums.percona.com/t/number-of-queries-with-response-time-slower-than-3ms-using-pt-query-digest/4360>\
**Category:** Percona Toolkit\
**Created:** [August 20, 2015, 1:17am UTC](https://forums.percona.com/t/number-of-queries-with-response-time-slower-than-3ms-using-pt-query-digest/4360 "2015-08-20T01:17:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michelkogan](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@michelkogan](https://forums.percona.com/u/michelkogan)\
**Post date:** [August 20, 2015, 1:17am UTC](https://forums.percona.com/t/number-of-queries-with-response-time-slower-than-3ms-using-pt-query-digest/4360/1 "2015-08-20T01:17:07Z")

</div>

I want to know how many queries have response time more than 3 milliseconds. How can I know that using pt-query-digest ?  
I’m using ‘–type tcpdump’ and everything works fine but really don’t know how to create a rule to get both “total number of queries” and “total number of queries with response time more than 3ms”.  
Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![michelkogan](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@michelkogan](https://forums.percona.com/u/michelkogan)\
**Post date:** [August 20, 2015, 2:07am UTC](https://forums.percona.com/t/number-of-queries-with-response-time-slower-than-3ms-using-pt-query-digest/4360/2 "2015-08-20T02:07:53Z")

</div>

I found the answer myself:  
You can do it using --filter ($event-\>{Query\_time} \> 0.003 ? $event-\>{Slow\_queries}++ : $event-\>{Ok\_queries}++) || 1
