@@ -97,7 +97,7 @@ func NewCollector() *Collector {
9797 }
9898}
9999
100- func PrintConfiguration (appCfg * config.AppConfig , dbName string , version string ) {
100+ func PrintConfiguration (appCfg * config.AppConfig , collections []config. CollectionDefinition , version string ) {
101101 fmt .Println ()
102102 fmt .Printf (" %s\n " , logger .CyanString ("genMongoLoad %s" , version ))
103103 fmt .Println (logger .CyanString (" --------------------------------------------------" ))
@@ -139,8 +139,28 @@ func PrintConfiguration(appCfg *config.AppConfig, dbName string, version string)
139139 w .Flush ()
140140 fmt .Println ()
141141
142+ // Logic to extract unique DBs and Namespaces
143+ uniqueDBs := make (map [string ]bool )
144+ var namespaces []string
145+ for _ , col := range collections {
146+ uniqueDBs [col .DatabaseName ] = true
147+ namespaces = append (namespaces , fmt .Sprintf ("%s.%s" , col .DatabaseName , col .Name ))
148+ }
149+
150+ var dbs []string
151+ for db := range uniqueDBs {
152+ dbs = append (dbs , db )
153+ }
154+ sort .Strings (dbs )
155+ sort .Strings (namespaces )
156+
142157 w = tabwriter .NewWriter (os .Stdout , 0 , 0 , 2 , ' ' , 0 )
143- fmt .Fprintf (w , " Database:\t %s\n " , dbName )
158+
159+ // Display Namespaces
160+ if len (namespaces ) > 0 {
161+ fmt .Fprintf (w , " Namespaces:\t %s\n " , strings .Join (namespaces , ", " ))
162+ }
163+
144164 fmt .Fprintf (w , " Workers:\t %d active\n " , appCfg .Concurrency )
145165 fmt .Fprintf (w , " Duration:\t %s\n " , appCfg .Duration )
146166 fmt .Fprintf (w , " Report Freq:\t %ds\n " , appCfg .StatusRefreshRateSec )
0 commit comments