# File lib/phusion_passenger/loader_shared_helpers.rb, line 164
        def dump_system_metrics
                if dir = ENV['PASSENGER_DEBUG_DIR']
                        # When invoked through Passenger Standalone, we want passenger-config
                        # to use the HelperAgent in the Passsenger Standalone buildout directory,
                        # because the one in the source root may not exist.
                        command = [
                                "env",
                                "PASSENGER_LOCATION_CONFIGURATION_FILE=#{PhusionPassenger.source_root}",
                                "#{PhusionPassenger.bin_dir}/passenger-config",
                                "system-metrics"
                        ]
                        contents = `#{Shellwords.join(command)}`
                        if $? && $?.exitstatus == 0
                                File.open("#{dir}/system_metrics", "wb") do |f|
                                        f.write(contents)
                                end
                        end
                end
        rescue SystemCallError
                # Don't care.
        end