Skip to content

Commit fab97cd

Browse files
Updated help menu and readme
1 parent f8af6a1 commit fab97cd

File tree

2 files changed

+33
-28
lines changed

2 files changed

+33
-28
lines changed

README.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ make build
7373
To view the full usage guide, including available flags and environment variables, run the help command:
7474

7575
```bash
76+
bin/plgm --help
7677
plgm: Percona Load Generator for MongoDB Clusters
7778
Usage: bin/plgm [flags] [config_file]
7879

@@ -89,38 +90,40 @@ Flags:
8990

9091
Environment Variables (Overrides):
9192
[Connection]
92-
PERCONALOAD_URI Connection URI
93-
PERCONALOAD_USERNAME Database User
94-
PERCONALOAD_PASSWORD Database Password (Recommended: Use Prompt)
95-
PERCONALOAD_DIRECT_CONNECTION Force direct connection (true/false)
96-
PERCONALOAD_REPLICA_SET Replica Set name
97-
PERCONALOAD_READ_PREFERENCE nearest
93+
PERCONALOAD_URI Connection URI
94+
PERCONALOAD_USERNAME Database User
95+
PERCONALOAD_PASSWORD Database Password (Recommended: Use Prompt)
96+
PERCONALOAD_DIRECT_CONNECTION Force direct connection (true/false)
97+
PERCONALOAD_REPLICA_SET Replica Set name
98+
PERCONALOAD_READ_PREFERENCE nearest
9899

99100
[Workload Core]
100-
PERCONALOAD_DEFAULT_WORKLOAD Use built-in workload (true/false)
101-
PERCONALOAD_COLLECTIONS_PATH Path to collection JSON
102-
PERCONALOAD_QUERIES_PATH Path to query JSON
103-
PERCONALOAD_DURATION Test duration (e.g. 60s, 5m)
104-
PERCONALOAD_CONCURRENCY Number of active workers
105-
PERCONALOAD_DOCUMENTS_COUNT Initial seed document count
106-
PERCONALOAD_DROP_COLLECTIONS Drop collections on start (true/false)
107-
PERCONALOAD_SKIP_SEED Do not seed initial data on start (true/false)
108-
PERCONALOAD_DEBUG_MODE Enable verbose logic logs (true/false)
101+
PERCONALOAD_DEFAULT_WORKLOAD Use built-in workload (true/false)
102+
PERCONALOAD_COLLECTIONS_PATH Path to collection JSON
103+
PERCONALOAD_QUERIES_PATH Path to query JSON
104+
PERCONALOAD_DURATION Test duration (e.g. 60s, 5m)
105+
PERCONALOAD_CONCURRENCY Number of active workers
106+
PERCONALOAD_DOCUMENTS_COUNT Initial seed document count
107+
PERCONALOAD_DROP_COLLECTIONS Drop collections on start (true/false)
108+
PERCONALOAD_SKIP_SEED Do not seed initial data on start (true/false)
109+
PERCONALOAD_DEBUG_MODE Enable verbose logic logs (true/false)
110+
PERCONALOAD_USE_TRANSACTIONS Enable transactional workloads (true/false)
109111

110112
[Operation Ratios] (Must sum to ~100)
111-
PERCONALOAD_FIND_PERCENT % of ops that are FIND
112-
PERCONALOAD_UPDATE_PERCENT % of ops that are UPDATE
113-
PERCONALOAD_INSERT_PERCENT % of ops that are INSERT
114-
PERCONALOAD_DELETE_PERCENT % of ops that are DELETE
115-
PERCONALOAD_AGGREGATE_PERCENT % of ops that are AGGREGATE
113+
PERCONALOAD_FIND_PERCENT % of ops that are FIND
114+
PERCONALOAD_UPDATE_PERCENT % of ops that are UPDATE
115+
PERCONALOAD_INSERT_PERCENT % of ops that are INSERT
116+
PERCONALOAD_DELETE_PERCENT % of ops that are DELETE
117+
PERCONALOAD_AGGREGATE_PERCENT % of ops that are AGGREGATE
118+
PERCONALOAD_TRANSACTION_PERCENT % of ops that are TRANSACTIONAL
116119

117120
[Performance Optimization]
118-
PERCONALOAD_FIND_BATCH_SIZE Docs returned per cursor batch
119-
PERCONALOAD_FIND_LIMIT Max docs per Find query
120-
PERCONALOAD_INSERT_CACHE_SIZE Generator buffer size
121-
PERCONALOAD_OP_TIMEOUT_MS Soft timeout per DB op (ms)
122-
PERCONALOAD_RETRY_ATTEMPTS Retry attempts for failures
123-
PERCONALOAD_RETRY_BACKOFF_MS Wait time between retries (ms)
121+
PERCONALOAD_FIND_BATCH_SIZE Docs returned per cursor batch
122+
PERCONALOAD_FIND_LIMIT Max docs per Find query
123+
PERCONALOAD_INSERT_CACHE_SIZE Generator buffer size
124+
PERCONALOAD_OP_TIMEOUT_MS Soft timeout per DB op (ms)
125+
PERCONALOAD_RETRY_ATTEMPTS Retry attempts for failures
126+
PERCONALOAD_RETRY_BACKOFF_MS Wait time between retries (ms)
124127
PERCONALOAD_STATUS_REFRESH_RATE_SEC Status report interval (sec)
125128
GOMAXPROCS Go Runtime CPU limit
126129
```
@@ -186,7 +189,7 @@ You can override any setting in `config.yaml` using environment variables. This
186189
| `debug_mode` | `PERCONALOAD_DEBUG_MODE` | Enable verbose debug logging (`true`/`false`) | `false` |
187190
| `use_transactions` | `PERCONALOAD_USE_TRANSACTIONS` | Enable Transactional Workloads (`true`/`false`) | `false` |
188191
| **Operation Ratios** | | (Must sum to ~100) | |
189-
| `find_percent` | `PERCONALOAD_FIND_PERCENT` | Percentage of Find operations | `55` |
192+
| `find_percent` | `PERCONALOAD_FIND_PERCENT` | Percentage of Find operations | `50` |
190193
| `insert_percent` | `PERCONALOAD_INSERT_PERCENT` | Percentage of Insert operations (this is not related to the initial seed inserts) | `20` |
191194
| `update_percent` | `PERCONALOAD_UPDATE_PERCENT` | Percentage of Update operations | `10` |
192195
| `delete_percent` | `PERCONALOAD_DELETE_PERCENT` | Percentage of Delete operations | `10` |
@@ -366,7 +369,7 @@ Control how plgm reacts to network lag or database pressure.
366369

367370
### 3. Custom Connection Parameters (`custom_params`)
368371

369-
In the `config.yaml`, the `custom_params` section allows you to pass arbitrary options directly to the MongoDB driver's connection string. These are critical for tuning network throughput and security.
372+
In the `config.yaml`, the `custom_params` section allows you to pass arbitrary options directly to the MongoDB driver's connection string. These are critical for tuning network throughput and security. Here are some examples you can use, all MongoDB connection parameters are supported.
370373

371374
```yaml
372375
custom_params:

cmd/plgm/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ func main() {
5858
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_DROP_COLLECTIONS", "Drop collections on start (true/false)")
5959
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_SKIP_SEED", "Do not seed initial data on start (true/false)")
6060
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_DEBUG_MODE", "Enable verbose logic logs (true/false)")
61+
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_USE_TRANSACTIONS", "Enable transactional workloads (true/false)")
6162

6263
fmt.Fprintf(os.Stderr, "\n [Operation Ratios] (Must sum to ~100)\n")
6364
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_FIND_PERCENT", "% of ops that are FIND")
6465
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_UPDATE_PERCENT", "% of ops that are UPDATE")
6566
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_INSERT_PERCENT", "% of ops that are INSERT")
6667
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_DELETE_PERCENT", "% of ops that are DELETE")
6768
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_AGGREGATE_PERCENT", "% of ops that are AGGREGATE")
69+
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_TRANSACTION_PERCENT", "% of ops that are TRANSACTIONAL")
6870

6971
fmt.Fprintf(os.Stderr, "\n [Performance Optimization]\n")
7072
fmt.Fprintf(os.Stderr, " %-35s %s\n", "PERCONALOAD_FIND_BATCH_SIZE", "Docs returned per cursor batch")

0 commit comments

Comments
 (0)