Added QueryCounter helper class for specs.