func (rn *Runner) SetTPS(tps int) {
	rn.tps = tps
}
SetTPS set transaction per second
package sim
import (
	"bufio"
	"context"
	"encoding/json"
	"fmt"
	"log"
	"os"
	"os/signal"
	"runtime"
	"strings"
	"sync"
	"syscall"
	"time"
	"github.com/simagix/gox"
	anly "github.com/simagix/keyhole/analytics"
	"github.com/simagix/keyhole/mdb"
	"go.mongodb.org/mongo-driver/bson"
	"go.mongodb.org/mongo-driver/mongo"
	"go.mongodb.org/mongo-driver/mongo/options"
	"go.mongodb.org/mongo-driver/x/mongo/driver/connstring"
)
const (
	outdir = "./out"
)
type Runner struct {
	Logger  *gox.Logger         `bson:"keyhole"`
	Metrics map[string][]bson.M `bson:"metrics"`
	Results []string            `bson:"results"`
	auto           bool
	channel        chan string
	client         *mongo.Client
	clusterType    string
	collectionName string
	conns          int
	connString     connstring.ConnString
	dbName         string
	drop           bool
	duration       int
	filename       string
	mutex          sync.RWMutex
	peek           bool
	simOnly        bool
	tps            int
	txFilename     string
	uri            string
	uriList        []string
	verbose        bool
}
func NewRunner(connString connstring.ConnString) (*Runner, error) {
	var err error
	runner := Runner{Logger: gox.GetLogger("keyhole"), connString: connString, conns: runtime.NumCPU(),
		channel: make(chan string), collectionName: mdb.ExamplesCollection, Metrics: map[string][]bson.M{},
		mutex: sync.RWMutex{}}
	runner.dbName = connString.Database
	if runner.dbName == "" {
		runner.dbName = mdb.KeyholeDB
	}
	if runner.client, err = mdb.NewMongoClient(connString.String()); err != nil {
		return &runner, err
	}
	stats := mdb.NewClusterStats("")
	stats.GetClusterStatsSummary(runner.client)
	runner.clusterType = stats.Cluster
	if runner.clusterType == "" {
		runner.Logger.Warn("unable to retrieve cluster type")
	}
	runner.uriList = []string{connString.String()}
	if runner.clusterType == mdb.Sharded {
		if shards, err := mdb.GetShards(runner.client); err != nil {
			return &runner, err
		} else if runner.uriList, err = mdb.GetAllShardURIs(shards, connString); err != nil {
			return &runner, err
		}
	}
	runner.uri = runner.uriList[len(runner.uriList)-1]
	return &runner, nil
}
func (rn *Runner) SetCollection(collectionName string) {
	if collectionName != "" {
		rn.collectionName = collectionName
	} else {
		rn.collectionName = mdb.ExamplesCollection
	}
}