Fixing an error with "queries_per_second" action on a replicaset.

This is the fix for the error

CRITICAL - General MongoDB Error: not master

While working on a replicaset with "queries_per_second" action.