Skip to content

Commit 4a2a780

Browse files
Updated startup banner
1 parent 5af93ce commit 4a2a780

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ You can supply your own collections and queries using the `PLGM_COLLECTIONS_PATH
165165
plgm supports two loading modes:
166166

167167
#### 1. Single File Mode
168-
If you point to a specific file, plgm will load **only** that file, regardless of its name.
168+
If you point to a specific file, plgm will load **only** that file, regardless of its name and will ignore the default workload setting.
169169

170170
```bash
171171
# Loads only my_custom_workload.json
172172
export PLGM_COLLECTIONS_PATH="./resources/collections/my_custom_workload.json"
173173
```
174174

175175
#### 2. Directory Mode (Multi-file)
176-
If you point to a folder, plgm will scan and merge **all** `.json` files found in that folder. This allows you to split complex schemas across multiple files.
176+
If you point to a folder, plgm will scan and merge **all** `.json` files found in that folder. This allows you to split complex schemas across multiple files. The default workload will be ignored.
177177

178178
```bash
179179
# Loads all .json files in the /custom folder

internal/stats/collector.go

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,32 @@ func PrintConfiguration(appCfg *config.AppConfig, collections []config.Collectio
313313
fmt.Fprintf(w, " Duration:\t%s\n", appCfg.Duration)
314314

315315
// Feedback: Active Workload Mode
316-
mode := "Custom (default.json excluded)"
317-
if appCfg.DefaultWorkload {
318-
mode = "Default (Only default.json)"
319-
// Warning: Only show if user explicitly set PLGM_COLLECTIONS_PATH in env
320-
// This avoids warning users who just run with default config.yaml
321-
if os.Getenv("PLGM_COLLECTIONS_PATH") != "" {
322-
mode += " [Warning: Ignoring other files in custom path!]"
316+
// Check if the provided path is a single file or a directory
317+
isSingleFile := false
318+
if appCfg.CollectionsPath != "" {
319+
info, err := os.Stat(appCfg.CollectionsPath)
320+
if err == nil && !info.IsDir() {
321+
isSingleFile = true
323322
}
323+
}
324+
325+
mode := "Custom (default.json excluded)"
326+
327+
if isSingleFile {
328+
mode = "Explicit File (Default filtering ignored)"
324329
} else {
325-
if appCfg.CollectionsPath == "" {
326-
mode = "Custom (No path provided?)"
330+
// Directory or Empty Path Logic
331+
if appCfg.DefaultWorkload {
332+
mode = "Default (Only default.json)"
333+
// Warning: Only show if user explicitly set PLGM_COLLECTIONS_PATH in env
334+
// This avoids warning users who just run with default config.yaml
335+
if os.Getenv("PLGM_COLLECTIONS_PATH") != "" {
336+
mode += " [Warning: Ignoring other files in custom path!]"
337+
}
338+
} else {
339+
if appCfg.CollectionsPath == "" {
340+
mode = "Custom (No path provided?)"
341+
}
327342
}
328343
}
329344
fmt.Fprintf(w, " Workload Mode:\t%s\n", mode)

0 commit comments

Comments
 (0)