setupBenchmarkConfig creates and stores a test configuration
()
| 32 | |
| 33 | // setupBenchmarkConfig creates and stores a test configuration |
| 34 | func setupBenchmarkConfig() *config.Configuration { |
| 35 | cnf := &config.Configuration{ |
| 36 | Redis: config.RedisConfig{ |
| 37 | Dns: "localhost:6379", |
| 38 | }, |
| 39 | Queue: config.QueueConfig{ |
| 40 | WebhookQueue: "webhook_queue", |
| 41 | TransactionQueue: "transaction_queue", |
| 42 | IndexQueue: "index_queue", |
| 43 | InflightExpiryQueue: "inflight_expiry_queue", |
| 44 | NumberOfQueues: 1, |
| 45 | }, |
| 46 | Server: config.ServerConfig{SecretKey: "benchmark-secret-key"}, |
| 47 | Transaction: config.TransactionConfig{ |
| 48 | BatchSize: 100000, |
| 49 | MaxQueueSize: 1000, |
| 50 | MaxWorkers: 10, |
| 51 | LockDuration: 30 * time.Second, |
| 52 | IndexQueuePrefix: "transactions", |
| 53 | }, |
| 54 | } |
| 55 | config.ConfigStore.Store(cnf) |
| 56 | return cnf |
| 57 | } |
| 58 | |
| 59 | // createTestBalance creates a test balance with the given ID and amount |
| 60 | func createTestBalance(id string, balance int64) *model.Balance { |
no outgoing calls
no test coverage detected