This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'yaml' | |
| require 'nokogiri' | |
| require 'openscap' | |
| require 'tempfile' | |
| require 'pathname' | |
| require 'trollop' | |
| class ScapTest | |
| PROFILE_ID = "xccdf_org.ssgproject.content_profile_linux-admin-scap".freeze | |
| SSG_XML_PATH = Pathname.new("/usr/share/xml/scap/ssg/content/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| files = Dir.glob("*postgresql.log*").sort | |
| files << files.shift if files.first == "postgresql.log" | |
| regex = /(\d+-\d+-\d+ \d+:\d+:\d+ \w+).*vacuum of table "(\w+)\.(\w+)\.(\w+)".*\n.*pages: (\d+) removed, (\d+) remain, (\d+) skipped due to pins\n.*tuples: (\d+) removed, (\d+) remain, (\d+)/ | |
| puts files | |
| files.each do |log_file_name| | |
| begin | |
| matches = File.read(log_file_name).scan(regex) | |
| rescue => e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pg' | |
| require 'benchmark' | |
| require 'io/console' | |
| class DbPerf | |
| TEST_DB = 'timing_test_database' | |
| TEST_TABLE = 'timing_test_table' | |
| INSERT_QUERY = "insert into #{TEST_TABLE} (data) values ('#{"a" * 100}')" | |
| def initialize(host, db_user, password) |
NewerOlder