gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Add a small tool to inspect databases #967

Closed GernotMaier closed 4 weeks ago

GernotMaier commented 1 month ago

Add a simple tool to quickly list the available databases and its collections. I've need this now a couple of times and it is simply faster than opening robot 3T (or something similar). Also means that we reduce the necessity that developers install robot 3T. And the last point is that this is a tool to quickly check the mongoDB status.

This gives e.g. (with my limited local database instance and not the full one running at DESY)

python simtools/applications/db_inspect_databases.py --db_name all
Database: Staging-CTA-Simulation-Model-v0-3-0
   Collections: ['configuration_sim_telarray', 'telescopes', 'metadata', 'sites', 'calibration_devices', 'fs.files', 'fs.chunks']
ctao-dpps-sonarqube[bot] commented 1 month ago

Failed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Failed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Failed

Analysis Details

2 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Failed

Analysis Details

2 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Passed

Analysis Details

16 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 1 month ago

Failed

Analysis Details

3 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

VictorBarbosaMartins commented 1 month ago

I am starting reviewing this, but I already have a question. What do you mean by local database instance? These are DBs hosted locally in your laptop? this is quite strange to me, as the very concept of DB is to make it remotely accessible in the most efficient way possible. Perhaps I missed something, but can you please clarify this to me?

GernotMaier commented 1 month ago

Exactly. You can run the DB locally, which is especially useful for heaving development and debugging, tests. etc without having any impact on the remove DB which is used by others.

GernotMaier commented 4 weeks ago

Thanks for the review!