refactor: extract concurrent query count function from FilterChainProxy
into a filter.