Open sergiik opened 8 years ago
Hi @sergiik : I agree to your comment. I might execute the configprint once and write everything to a temp file or parse it into variables at once. It might take a while though before I do so but feel free to build something nice and create a Pull request if I'm not fast enough ;-)
Just a note about performance, it appears that the two calls out to the puppet service itself, 1 to determine the major version and 1 to get the necessary configuration settings, total about 1.6 seconds total of execution time. 0.8 seconds per call. So improving the script beyond 1.6 seconds per run would be very difficult, unless there are alternative techniques for retrieving the desired values. In my environment I am going to set the major version statically (or maybe via a parameter), which gets the execution time to down around 0.8 seconds.
Hi, Right now most of time script spends in running 'puppet config print' 4 times. It's inefficient and causes noticeable runtime for the script. It's not a big deal but when monitoring system is running many small scripts it's better to have them running in efficient way so that total execution time for monitoring and load is as small as possible. It would be nice to have all needed options requested with one 'puppet config print' run.