File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 513513 'Defaults to 10.' ] ,
514514 [ '--output_dir DIR' ,
515515 'Write metrics to a timestamped file under DIR instead of' ,
516- 'printing to STDOUT' ] ] . freeze
516+ 'printing to STDOUT' ] ,
517+ [ '-p' , '--[no-]print' , 'Always print to STDOUT' ] ] . freeze
517518
518519 def initialize ( argv = [ ] )
519520 @action = :collect_data
573574 FileUtils . mkdir_p ( host_dir ) unless File . directory? ( host_dir )
574575 output_file = File . join ( host_dir , timestamp . strftime ( '%Y%m%dT%H%M%SZ' ) + '.json' )
575576
576- File . write ( output_file , JSON . generate ( data ) )
577+ output = JSON . generate ( data )
578+ File . write ( output_file , output )
579+ $stdout. puts ( output ) if @options [ :print ]
577580 else
578581 $stdout. puts ( JSON . generate ( data ) )
579582 end
Original file line number Diff line number Diff line change 1111 String $metrics_ensure = $puppet_metrics_collector::system::system_metrics_ensure,
1212 Integer $collection_frequency = $puppet_metrics_collector::system::collection_frequency,
1313 Integer $retention_days = $puppet_metrics_collector::system::retention_days,
14+ String $metrics_shipping_command = $puppet_metrics_collector::system::metrics_shipping_command,
1415) {
1516 $metrics_output_dir = " ${puppet_metrics_collector::system::output_dir} /postgres"
1617 $metrics_output_dir_ensure = $metrics_ensure ? {
2627
2728 $metrics_command = [" ${puppet_metrics_collector::system::scripts_dir} /psql_metrics" ,
2829 ' --output_dir' , $metrics_output_dir ,
30+ $metrics_shipping_command ,
2931 ' > /dev/null' ].join(' ' )
3032
3133 $tidy_command = " ${puppet_metrics_collector::system::scripts_dir} /metrics_tidy -d ${metrics_output_dir} -r ${retention_days} "
You can’t perform that action at this time.
0 commit comments