From dd05e2c63cbbd1102789530f9796fc5d4acf0420 Mon Sep 17 00:00:00 2001 From: Bohan Zhang Date: Wed, 23 Oct 2019 19:46:33 -0700 Subject: [PATCH] add integration test --- client/driver/fabfile.py | 57 +- integrationTests/data/0__knobs.json | 267 +++++++++ integrationTests/data/0__metrics_after.json | 584 ++++++++++++++++++ integrationTests/data/0__metrics_before.json | 581 ++++++++++++++++++ integrationTests/data/0__summary.json | 8 + integrationTests/data/1__knobs.json | 267 +++++++++ integrationTests/data/1__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/1__metrics_before.json | 584 ++++++++++++++++++ integrationTests/data/1__summary.json | 8 + integrationTests/data/2__knobs.json | 267 +++++++++ integrationTests/data/2__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/2__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/2__summary.json | 8 + integrationTests/data/3__knobs.json | 267 +++++++++ integrationTests/data/3__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/3__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/3__summary.json | 8 + integrationTests/data/4__knobs.json | 267 +++++++++ integrationTests/data/4__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/4__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/4__summary.json | 8 + integrationTests/data/5__knobs.json | 267 +++++++++ integrationTests/data/5__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/5__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/5__summary.json | 8 + integrationTests/data/6__knobs.json | 267 +++++++++ integrationTests/data/6__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/6__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/6__summary.json | 8 + integrationTests/data/7__knobs.json | 267 +++++++++ integrationTests/data/7__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/7__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/7__summary.json | 8 + integrationTests/data/8__knobs.json | 267 +++++++++ integrationTests/data/8__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/8__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/8__summary.json | 8 + integrationTests/data/9__knobs.json | 267 +++++++++ integrationTests/data/9__metrics_after.json | 585 +++++++++++++++++++ integrationTests/data/9__metrics_before.json | 585 +++++++++++++++++++ integrationTests/data/9__summary.json | 8 + 41 files changed, 14495 insertions(+), 6 deletions(-) create mode 100644 integrationTests/data/0__knobs.json create mode 100644 integrationTests/data/0__metrics_after.json create mode 100644 integrationTests/data/0__metrics_before.json create mode 100644 integrationTests/data/0__summary.json create mode 100644 integrationTests/data/1__knobs.json create mode 100644 integrationTests/data/1__metrics_after.json create mode 100644 integrationTests/data/1__metrics_before.json create mode 100644 integrationTests/data/1__summary.json create mode 100644 integrationTests/data/2__knobs.json create mode 100644 integrationTests/data/2__metrics_after.json create mode 100644 integrationTests/data/2__metrics_before.json create mode 100644 integrationTests/data/2__summary.json create mode 100644 integrationTests/data/3__knobs.json create mode 100644 integrationTests/data/3__metrics_after.json create mode 100644 integrationTests/data/3__metrics_before.json create mode 100644 integrationTests/data/3__summary.json create mode 100644 integrationTests/data/4__knobs.json create mode 100644 integrationTests/data/4__metrics_after.json create mode 100644 integrationTests/data/4__metrics_before.json create mode 100644 integrationTests/data/4__summary.json create mode 100644 integrationTests/data/5__knobs.json create mode 100644 integrationTests/data/5__metrics_after.json create mode 100644 integrationTests/data/5__metrics_before.json create mode 100644 integrationTests/data/5__summary.json create mode 100644 integrationTests/data/6__knobs.json create mode 100644 integrationTests/data/6__metrics_after.json create mode 100644 integrationTests/data/6__metrics_before.json create mode 100644 integrationTests/data/6__summary.json create mode 100644 integrationTests/data/7__knobs.json create mode 100644 integrationTests/data/7__metrics_after.json create mode 100644 integrationTests/data/7__metrics_before.json create mode 100644 integrationTests/data/7__summary.json create mode 100644 integrationTests/data/8__knobs.json create mode 100644 integrationTests/data/8__metrics_after.json create mode 100644 integrationTests/data/8__metrics_before.json create mode 100644 integrationTests/data/8__summary.json create mode 100644 integrationTests/data/9__knobs.json create mode 100644 integrationTests/data/9__metrics_after.json create mode 100644 integrationTests/data/9__metrics_before.json create mode 100644 integrationTests/data/9__summary.json diff --git a/client/driver/fabfile.py b/client/driver/fabfile.py index e2c317a..ac8b831 100644 --- a/client/driver/fabfile.py +++ b/client/driver/fabfile.py @@ -264,9 +264,10 @@ def free_cache(): @task -def upload_result(result_dir=None, prefix=None): +def upload_result(result_dir=None, prefix=None, upload_code=None): result_dir = result_dir or os.path.join(CONF['controller_home'], 'output') prefix = prefix or '' + upload_code = upload_code or CONF['upload_code'] files = {} for base in ('summary', 'knobs', 'metrics_before', 'metrics_after'): @@ -286,7 +287,7 @@ def upload_result(result_dir=None, prefix=None): files[base] = open(fpath, 'rb') response = requests.post(CONF['upload_url'] + '/new_result/', files=files, - data={'upload_code': CONF['upload_code']}) + data={'upload_code': upload_code}) if response.status_code != 200: raise Exception('Error uploading result.\nStatus: {}\nMessage: {}\n'.format( response.status_code, response.content)) @@ -300,10 +301,11 @@ def upload_result(result_dir=None, prefix=None): @task -def get_result(max_time_sec=180, interval_sec=5): +def get_result(max_time_sec=180, interval_sec=5, upload_code=None): max_time_sec = int(max_time_sec) interval_sec = int(interval_sec) - url = CONF['upload_url'] + '/query_and_get/' + CONF['upload_code'] + upload_code = upload_code or CONF['upload_code'] + url = CONF['upload_url'] + '/query_and_get/' + upload_code elapsed = 0 response_dict = None response = '' @@ -378,7 +380,7 @@ def add_udf(): @task -def upload_batch(result_dir=None, sort=True): +def upload_batch(result_dir=None, sort=True, upload_code=None): result_dir = result_dir or CONF['save_path'] sort = _parse_bool(sort) results = glob.glob(os.path.join(result_dir, '*__summary.json')) @@ -391,7 +393,7 @@ def upload_batch(result_dir=None, sort=True): prefix = os.path.basename(result) prefix_len = os.path.basename(result).find('_') + 2 prefix = prefix[:prefix_len] - upload_result(result_dir=result_dir, prefix=prefix) + upload_result(result_dir=result_dir, prefix=prefix, upload_code=upload_code) LOG.info('Uploaded result %d/%d: %s__*.json', i + 1, count, prefix) @@ -643,3 +645,46 @@ def run_loops(max_iter=1): LOG.info('The %s-th Loop Starts / Total Loops %s', i + 1, max_iter) loop(i % RELOAD_INTERVAL) LOG.info('The %s-th Loop Ends / Total Loops %s', i + 1, max_iter) + + +@task +def rename_batch(result_dir=None): + result_dir = result_dir or CONF['save_path'] + results = glob.glob(os.path.join(result_dir, '*__summary.json')) + results = sorted(results) + count = len(results) + for i, result in enumerate(results): + prefix = os.path.basename(result) + prefix_len = os.path.basename(result).find('_') + 2 + prefix = prefix[:prefix_len] + new_prefix = str(i) + '__' + files = {} + for base in ('summary', 'knobs', 'metrics_before', 'metrics_after'): + fpath = os.path.join(result_dir, prefix + base + '.json') + rename_path = os.path.join(result_dir, new_prefix + base + '.json') + os.rename(fpath, rename_path) + + +@task +def integration_tests(): + + # Create test website + response = requests.get(CONF['upload_url'] + '/test/create/') + LOG.info(response.content) + + # Upload training data + LOG.info('Upload training data to no tuning session') + upload_batch(result_dir='../../integrationTests/data/',upload_code='ottertuneTestNoTuning') + + # TO DO: BG ready + # Test DNN + LOG.info('Test DNN (deep neural network)') + upload_result(result_dir='../../integrationTests/data/', prefix='0__', upload_code='ottertuneTestTuningDNN') + response = get_result(upload_code='ottertuneTestTuningDNN') + assert response['status'] == 'good' + + # Test GPR + LOG.info('Test GPR (gaussian process regression)') + upload_result(result_dir='../../integrationTests/data/', prefix='0__', upload_code='ottertuneTestTuningGPR') + response = get_result(upload_code='ottertuneTestTuningGPR') + assert response['status'] == 'good' \ No newline at end of file diff --git a/integrationTests/data/0__knobs.json b/integrationTests/data/0__knobs.json new file mode 100644 index 0000000..f1e7600 --- /dev/null +++ b/integrationTests/data/0__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "1000", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.572503", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "1min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "265", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "6GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "3", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "5GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "4.29795", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "715MB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "215MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "293MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/0__metrics_after.json b/integrationTests/data/0__metrics_after.json new file mode 100644 index 0000000..b4f5fd8 --- /dev/null +++ b/integrationTests/data/0__metrics_after.json @@ -0,0 +1,584 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3708990663", + "buffers_backend": "1747699460", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1838883093", + "buffers_clean": "90785506", + "checkpoint_sync_time": "13818100", + "checkpoint_write_time": "214789605", + "checkpoints_req": "9958", + "checkpoints_timed": "2925", + "maxwritten_clean": "291284", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "1529548", + "idx_tup_fetch": "7914511", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "470507", + "n_live_tup": "5999969", + "n_mod_since_analyze": "473247", + "n_tup_del": "0", + "n_tup_hot_upd": "25593", + "n_tup_ins": "6000000", + "n_tup_upd": "473247", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "752519", + "idx_tup_fetch": "752519", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "231124", + "n_live_tup": "200", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "237149", + "n_tup_ins": "200", + "n_tup_upd": "246017", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "2", + "autovacuum_count": "0", + "idx_scan": "454461", + "idx_tup_fetch": "2146543", + "last_autoanalyze": "2019-10-01 02:04:03.755589-04", + "n_dead_tup": "214108", + "n_live_tup": "1710880", + "n_mod_since_analyze": "187083", + "n_tup_del": "227230", + "n_tup_hot_upd": "0", + "n_tup_ins": "1950470", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "500404", + "idx_tup_fetch": "69361608", + "n_dead_tup": "2213123", + "n_live_tup": "62548466", + "n_mod_since_analyze": "64818561", + "n_tup_del": "0", + "n_tup_hot_upd": "78766", + "n_tup_ins": "62548466", + "n_tup_upd": "2270095", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6246017", + "n_mod_since_analyze": "246017", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6246017", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "2581423", + "idx_tup_fetch": "2578787", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "72275089", + "idx_tup_fetch": "72275089", + "n_dead_tup": "2486403", + "n_live_tup": "20000000", + "n_mod_since_analyze": "22553023", + "n_tup_del": "0", + "n_tup_hot_upd": "152030", + "n_tup_ins": "20000000", + "n_tup_upd": "2553023", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "3288789", + "idx_tup_fetch": "21288786", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "218977", + "n_live_tup": "6255751", + "n_mod_since_analyze": "482981", + "n_tup_del": "0", + "n_tup_hot_upd": "11847", + "n_tup_ins": "6258387", + "n_tup_upd": "227230", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "1277852", + "idx_tup_fetch": "1277852", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "470373", + "n_live_tup": "1517", + "n_mod_since_analyze": "5586", + "n_tup_del": "0", + "n_tup_hot_upd": "387047", + "n_tup_ins": "2000", + "n_tup_upd": "504404", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "22592502", + "heap_blks_read": "3340995", + "idx_blks_hit": "20979694", + "idx_blks_read": "412817", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "13915738", + "heap_blks_read": "176154", + "idx_blks_hit": "13284067", + "idx_blks_read": "970835", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "2477512", + "heap_blks_read": "108531", + "idx_blks_hit": "5169990", + "idx_blks_read": "5154", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "884677", + "heap_blks_read": "127882", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "62234799", + "heap_blks_read": "4485", + "idx_blks_hit": "1665171", + "idx_blks_read": "41", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "138721657", + "heap_blks_read": "14304994", + "idx_blks_hit": "222732057", + "idx_blks_read": "1690343", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "1458870", + "heap_blks_read": "305739", + "idx_blks_hit": "2237121", + "idx_blks_read": "169766", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "3915470", + "heap_blks_read": "4256131", + "idx_blks_hit": "7012916", + "idx_blks_read": "979029", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "142213701", + "heap_blks_read": "10828", + "idx_blks_hit": "3262630", + "idx_blks_read": "968", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4038068", + "blks_read": "254970", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1796514", + "tup_inserted": "0", + "tup_returned": "25038018", + "tup_updated": "14", + "xact_commit": "66618", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "664877271", + "blks_read": "26866169", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "3", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "227322", + "tup_fetched": "177684291", + "tup_inserted": "103106512", + "tup_returned": "699470745", + "tup_updated": "6274134", + "xact_commit": "570882", + "xact_rollback": "2637" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2794174", + "blks_read": "109860", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "953250", + "tup_inserted": "0", + "tup_returned": "21940167", + "tup_updated": "0", + "xact_commit": "52258", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1775116", + "blks_read": "67108", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "570378", + "tup_inserted": "0", + "tup_returned": "15671359", + "tup_updated": "13", + "xact_commit": "31735", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "1277852", + "idx_tup_fetch": "1131350", + "idx_tup_read": "126828104", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "752519", + "idx_tup_fetch": "562721", + "idx_tup_read": "60913162", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "2581423", + "idx_tup_fetch": "2578787", + "idx_tup_read": "2578787", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "454461", + "idx_tup_fetch": "2146543", + "idx_tup_read": "47882665", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "22917", + "idx_tup_fetch": "6022916", + "idx_tup_read": "6024235", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "161174", + "idx_tup_fetch": "546138", + "idx_tup_read": "684041", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "500404", + "idx_tup_fetch": "69361608", + "idx_tup_read": "71566067", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "72275089", + "idx_tup_fetch": "59995443", + "idx_tup_read": "124088647", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "3262630", + "idx_blks_read": "968", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "1665171", + "idx_blks_read": "41", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "5169990", + "idx_blks_read": "5154", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "2237121", + "idx_blks_read": "169766", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "1081419", + "idx_blks_read": "449137", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "2012281", + "idx_blks_read": "467521", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "20979694", + "idx_blks_read": "412817", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "222732057", + "idx_blks_read": "1690343", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/0__metrics_before.json b/integrationTests/data/0__metrics_before.json new file mode 100644 index 0000000..8a19f41 --- /dev/null +++ b/integrationTests/data/0__metrics_before.json @@ -0,0 +1,581 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3692959832", + "buffers_backend": "1741292048", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1838672434", + "buffers_clean": "90148655", + "checkpoint_sync_time": "13751757", + "checkpoint_write_time": "214665311", + "checkpoints_req": "9948", + "checkpoints_timed": "2925", + "maxwritten_clean": "290648", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "1", + "idx_tup_fetch": "6000000", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "0", + "n_live_tup": "5999969", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6000000", + "n_tup_upd": "0", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "0", + "idx_tup_fetch": "0", + "last_autoanalyze": "2019-10-01 01:52:28.446885-04", + "n_dead_tup": "0", + "n_live_tup": "200", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "200", + "n_tup_upd": "0", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "600", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "1", + "idx_tup_fetch": "1692083", + "last_autoanalyze": "2019-10-01 01:52:27.655021-04", + "n_dead_tup": "0", + "n_live_tup": "1692083", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "1692083", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "1", + "idx_tup_fetch": "59995443", + "n_dead_tup": "0", + "n_live_tup": "59995443", + "n_mod_since_analyze": "59995443", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "59995443", + "n_tup_upd": "0", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6000000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6000000", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "0", + "idx_tup_fetch": "0", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "100000", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "59995443", + "idx_tup_fetch": "59995443", + "n_dead_tup": "0", + "n_live_tup": "20000000", + "n_mod_since_analyze": "20000000", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "20000000", + "n_tup_upd": "0", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "3", + "idx_tup_fetch": "18000000", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "0", + "n_live_tup": "6000000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6000000", + "n_tup_upd": "0", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "0", + "idx_tup_fetch": "0", + "last_autoanalyze": "2019-10-01 01:52:29.056627-04", + "n_dead_tup": "0", + "n_live_tup": "2000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "2000", + "n_tup_upd": "0", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "842040", + "heap_blks_read": "2957855", + "idx_blks_hit": "0", + "idx_blks_read": "229872", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "6241021", + "heap_blks_read": "97952", + "idx_blks_hit": "2051", + "idx_blks_read": "66928", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "2542", + "heap_blks_read": "1271", + "idx_blks_hit": "0", + "idx_blks_read": "1", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "128440", + "heap_blks_read": "124344", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "12", + "heap_blks_read": "3", + "idx_blks_hit": "0", + "idx_blks_read": "1", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "59117416", + "heap_blks_read": "4360259", + "idx_blks_hit": "180095972", + "idx_blks_read": "54841", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "29895", + "heap_blks_read": "16246", + "idx_blks_hit": "0", + "idx_blks_read": "6487", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "248380", + "heap_blks_read": "2891409", + "idx_blks_hit": "0", + "idx_blks_read": "22993", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "150", + "heap_blks_read": "30", + "idx_blks_hit": "1", + "idx_blks_read": "1", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4037127", + "blks_read": "254822", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1796046", + "tup_inserted": "0", + "tup_returned": "25033610", + "tup_updated": "14", + "xact_commit": "66610", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "246720695", + "blks_read": "10830975", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "0", + "tup_fetched": "145689968", + "tup_inserted": "99790620", + "tup_returned": "381590889", + "tup_updated": "55", + "xact_commit": "256", + "xact_rollback": "1" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2793953", + "blks_read": "109736", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "953195", + "tup_inserted": "0", + "tup_returned": "21935277", + "tup_updated": "0", + "xact_commit": "52248", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1774960", + "blks_read": "66988", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "570334", + "tup_inserted": "0", + "tup_returned": "15667447", + "tup_updated": "13", + "xact_commit": "31727", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "1", + "idx_tup_fetch": "1692083", + "idx_tup_read": "1692083", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "1", + "idx_tup_fetch": "6000000", + "idx_tup_read": "6000000", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "1", + "idx_tup_fetch": "59995443", + "idx_tup_read": "59995443", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "59995443", + "idx_tup_fetch": "59995443", + "idx_tup_read": "59995443", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "1", + "idx_blks_read": "1", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "0", + "idx_blks_read": "1", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "0", + "idx_blks_read": "1", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "0", + "idx_blks_read": "6487", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "1", + "idx_blks_read": "22992", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "0", + "idx_blks_read": "1", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "0", + "idx_blks_read": "229872", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "180095972", + "idx_blks_read": "54841", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/0__summary.json b/integrationTests/data/0__summary.json new file mode 100644 index 0000000..1888320 --- /dev/null +++ b/integrationTests/data/0__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569909672722, + "end_time": 1569909976978, + "observation_time": 304, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/1__knobs.json b/integrationTests/data/1__knobs.json new file mode 100644 index 0000000..40ad04f --- /dev/null +++ b/integrationTests/data/1__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "797", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.157563", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "16min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "1940", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "4GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "6", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "4GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "6.57119", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "7GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "479MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "928MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/1__metrics_after.json b/integrationTests/data/1__metrics_after.json new file mode 100644 index 0000000..46db95d --- /dev/null +++ b/integrationTests/data/1__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3710134560", + "buffers_backend": "1747924107", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1842360079", + "buffers_clean": "90788869", + "checkpoint_sync_time": "13822962", + "checkpoint_write_time": "215026010", + "checkpoints_req": "9972", + "checkpoints_timed": "2925", + "maxwritten_clean": "291284", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "3277954", + "idx_tup_fetch": "10106838", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "965010", + "n_live_tup": "5999969", + "n_mod_since_analyze": "1014600", + "n_tup_del": "0", + "n_tup_hot_upd": "318435", + "n_tup_ins": "6000000", + "n_tup_upd": "1014600", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "1613061", + "idx_tup_fetch": "1613061", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "271565", + "n_live_tup": "200", + "n_mod_since_analyze": "281713", + "n_tup_del": "0", + "n_tup_hot_upd": "507758", + "n_tup_ins": "200", + "n_tup_upd": "527730", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "2", + "autovacuum_count": "1", + "idx_scan": "973741", + "idx_tup_fetch": "2665434", + "last_autoanalyze": "2019-10-01 02:04:03.755589-04", + "last_autovacuum": "2019-10-01 02:11:32.549937-04", + "n_dead_tup": "157677", + "n_live_tup": "1715072", + "n_mod_since_analyze": "738460", + "n_tup_del": "486870", + "n_tup_hot_upd": "0", + "n_tup_ins": "2245024", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "1072431", + "idx_tup_fetch": "80107349", + "n_dead_tup": "4722627", + "n_live_tup": "65464051", + "n_mod_since_analyze": "70329908", + "n_tup_del": "0", + "n_tup_hot_upd": "217952", + "n_tup_ins": "65464051", + "n_tup_upd": "4865857", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6527730", + "n_mod_since_analyze": "527730", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6527730", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "5527670", + "idx_tup_fetch": "5522217", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "86340139", + "idx_tup_fetch": "86340139", + "n_dead_tup": "5165266", + "n_live_tup": "20000000", + "n_mod_since_analyze": "25468608", + "n_tup_del": "0", + "n_tup_hot_upd": "1564323", + "n_tup_ins": "20000000", + "n_tup_upd": "5468608", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "7044478", + "idx_tup_fetch": "25044475", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "468275", + "n_live_tup": "6547488", + "n_mod_since_analyze": "1034358", + "n_tup_del": "0", + "n_tup_hot_upd": "35122", + "n_tup_ins": "6552941", + "n_tup_upd": "486870", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "2738576", + "idx_tup_fetch": "2738576", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "652556", + "n_live_tup": "1517", + "n_mod_since_analyze": "579036", + "n_tup_del": "0", + "n_tup_hot_upd": "826407", + "n_tup_ins": "2000", + "n_tup_upd": "1080671", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "47597757", + "heap_blks_read": "3545844", + "idx_blks_hit": "44882844", + "idx_blks_read": "480525", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "22718802", + "heap_blks_read": "200074", + "idx_blks_hit": "29325100", + "idx_blks_read": "1002653", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "5422233", + "heap_blks_read": "109802", + "idx_blks_hit": "11076479", + "idx_blks_read": "5430", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "1748762", + "heap_blks_read": "131041", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "165598915", + "heap_blks_read": "11443", + "idx_blks_hit": "4011277", + "idx_blks_read": "93", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "256956574", + "heap_blks_read": "14822485", + "idx_blks_hit": "269773221", + "idx_blks_read": "1734008", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "4162716", + "heap_blks_read": "312348", + "idx_blks_hit": "5463827", + "idx_blks_read": "174768", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "8984646", + "heap_blks_read": "4509453", + "idx_blks_hit": "14337286", + "idx_blks_read": "1047309", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "349252012", + "heap_blks_read": "26418", + "idx_blks_hit": "8241650", + "idx_blks_read": "1473", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4038961", + "blks_read": "255028", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1796960", + "tup_inserted": "0", + "tup_returned": "25040470", + "tup_updated": "14", + "xact_commit": "66622", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1249759276", + "blks_read": "28117212", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "486962", + "tup_fetched": "214291889", + "tup_inserted": "106892918", + "tup_returned": "1161588922", + "tup_updated": "13444454", + "xact_commit": "1223221", + "xact_rollback": "5456" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2795320", + "blks_read": "109918", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "953789", + "tup_inserted": "0", + "tup_returned": "21943682", + "tup_updated": "0", + "xact_commit": "52270", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1776078", + "blks_read": "67166", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "570835", + "tup_inserted": "0", + "tup_returned": "15674789", + "tup_updated": "13", + "xact_commit": "31741", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "2738576", + "idx_tup_fetch": "1133850", + "idx_tup_read": "313211984", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "1613061", + "idx_tup_fetch": "562721", + "idx_tup_read": "162425405", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "5527670", + "idx_tup_fetch": "5522217", + "idx_tup_read": "5522217", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "973741", + "idx_tup_fetch": "2665434", + "idx_tup_read": "107537516", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "86340139", + "idx_tup_fetch": "59995443", + "idx_tup_read": "215788451", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "345927", + "idx_tup_fetch": "1174812", + "idx_tup_read": "1559277", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "1072431", + "idx_tup_fetch": "80107349", + "idx_tup_read": "84804674", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "8241650", + "idx_blks_read": "1473", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "4011277", + "idx_blks_read": "93", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "11076479", + "idx_blks_read": "5430", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "5463827", + "idx_blks_read": "174768", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "2612911", + "idx_blks_read": "424082", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "269773221", + "idx_blks_read": "1734008", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "3779668", + "idx_blks_read": "509864", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "44882844", + "idx_blks_read": "480525", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/1__metrics_before.json b/integrationTests/data/1__metrics_before.json new file mode 100644 index 0000000..73d5efd --- /dev/null +++ b/integrationTests/data/1__metrics_before.json @@ -0,0 +1,584 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3708990917", + "buffers_backend": "1747700215", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1838883971", + "buffers_clean": "90785547", + "checkpoint_sync_time": "13818110", + "checkpoint_write_time": "214811687", + "checkpoints_req": "9958", + "checkpoints_timed": "2925", + "maxwritten_clean": "291284", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "1529548", + "idx_tup_fetch": "7914511", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "470507", + "n_live_tup": "5999969", + "n_mod_since_analyze": "473247", + "n_tup_del": "0", + "n_tup_hot_upd": "25593", + "n_tup_ins": "6000000", + "n_tup_upd": "473247", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "752519", + "idx_tup_fetch": "752519", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "231124", + "n_live_tup": "200", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "237149", + "n_tup_ins": "200", + "n_tup_upd": "246017", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "2", + "autovacuum_count": "0", + "idx_scan": "454461", + "idx_tup_fetch": "2146543", + "last_autoanalyze": "2019-10-01 02:04:03.755589-04", + "n_dead_tup": "214108", + "n_live_tup": "1710880", + "n_mod_since_analyze": "187083", + "n_tup_del": "227230", + "n_tup_hot_upd": "0", + "n_tup_ins": "1950470", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "500404", + "idx_tup_fetch": "69361608", + "n_dead_tup": "2213123", + "n_live_tup": "62548466", + "n_mod_since_analyze": "64818561", + "n_tup_del": "0", + "n_tup_hot_upd": "78766", + "n_tup_ins": "62548466", + "n_tup_upd": "2270095", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6246017", + "n_mod_since_analyze": "246017", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6246017", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "2581423", + "idx_tup_fetch": "2578787", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "72275089", + "idx_tup_fetch": "72275089", + "n_dead_tup": "2486403", + "n_live_tup": "20000000", + "n_mod_since_analyze": "22553023", + "n_tup_del": "0", + "n_tup_hot_upd": "152030", + "n_tup_ins": "20000000", + "n_tup_upd": "2553023", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "3288789", + "idx_tup_fetch": "21288786", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "218977", + "n_live_tup": "6255751", + "n_mod_since_analyze": "482981", + "n_tup_del": "0", + "n_tup_hot_upd": "11847", + "n_tup_ins": "6258387", + "n_tup_upd": "227230", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "1277852", + "idx_tup_fetch": "1277852", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "470373", + "n_live_tup": "1517", + "n_mod_since_analyze": "5586", + "n_tup_del": "0", + "n_tup_hot_upd": "387047", + "n_tup_ins": "2000", + "n_tup_upd": "504404", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "22592546", + "heap_blks_read": "3384074", + "idx_blks_hit": "20979694", + "idx_blks_read": "412817", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "13915738", + "heap_blks_read": "176154", + "idx_blks_hit": "13284067", + "idx_blks_read": "970835", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "2477512", + "heap_blks_read": "108531", + "idx_blks_hit": "5169990", + "idx_blks_read": "5154", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "884677", + "heap_blks_read": "127882", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "62234799", + "heap_blks_read": "4485", + "idx_blks_hit": "1665171", + "idx_blks_read": "41", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "138723057", + "heap_blks_read": "14369312", + "idx_blks_hit": "222732057", + "idx_blks_read": "1690343", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "1458870", + "heap_blks_read": "305739", + "idx_blks_hit": "2237121", + "idx_blks_read": "169766", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "3915470", + "heap_blks_read": "4256131", + "idx_blks_hit": "7012916", + "idx_blks_read": "979029", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "142213701", + "heap_blks_read": "10828", + "idx_blks_hit": "3262630", + "idx_blks_read": "968", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4038068", + "blks_read": "254970", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1796514", + "tup_inserted": "0", + "tup_returned": "25038018", + "tup_updated": "14", + "xact_commit": "66618", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "664880849", + "blks_read": "26973869", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "227322", + "tup_fetched": "177685809", + "tup_inserted": "103106512", + "tup_returned": "699476107", + "tup_updated": "6274134", + "xact_commit": "570898", + "xact_rollback": "2639" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2795117", + "blks_read": "109914", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "953756", + "tup_inserted": "0", + "tup_returned": "21940748", + "tup_updated": "0", + "xact_commit": "52264", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1775940", + "blks_read": "67166", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "570813", + "tup_inserted": "0", + "tup_returned": "15672833", + "tup_updated": "13", + "xact_commit": "31737", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "1277852", + "idx_tup_fetch": "1131350", + "idx_tup_read": "126828104", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "752519", + "idx_tup_fetch": "562721", + "idx_tup_read": "60913162", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "2581423", + "idx_tup_fetch": "2578787", + "idx_tup_read": "2578787", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "454461", + "idx_tup_fetch": "2146543", + "idx_tup_read": "47882665", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "72275089", + "idx_tup_fetch": "59995443", + "idx_tup_read": "124088647", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "161174", + "idx_tup_fetch": "546138", + "idx_tup_read": "684041", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "500404", + "idx_tup_fetch": "69361608", + "idx_tup_read": "71566067", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "3262630", + "idx_blks_read": "968", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "1665171", + "idx_blks_read": "41", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "5169990", + "idx_blks_read": "5154", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "2237121", + "idx_blks_read": "169766", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "1028491", + "idx_blks_read": "411509", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "222732057", + "idx_blks_read": "1690343", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "2012281", + "idx_blks_read": "467521", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "20979694", + "idx_blks_read": "412817", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/1__summary.json b/integrationTests/data/1__summary.json new file mode 100644 index 0000000..743691a --- /dev/null +++ b/integrationTests/data/1__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569910014242, + "end_time": 1569910319313, + "observation_time": 305, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/2__knobs.json b/integrationTests/data/2__knobs.json new file mode 100644 index 0000000..7fa0693 --- /dev/null +++ b/integrationTests/data/2__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "383", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.894517", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "22min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "1600", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "8GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "4", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "14GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "1.69066", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "10GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "77MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "474MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/2__metrics_after.json b/integrationTests/data/2__metrics_after.json new file mode 100644 index 0000000..9eae399 --- /dev/null +++ b/integrationTests/data/2__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3711467829", + "buffers_backend": "1748211500", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1844005545", + "buffers_clean": "90793826", + "checkpoint_sync_time": "13824048", + "checkpoint_write_time": "215146850", + "checkpoints_req": "9975", + "checkpoints_timed": "2925", + "maxwritten_clean": "291291", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "5879293", + "idx_tup_fetch": "13368527", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1305530", + "n_live_tup": "5999969", + "n_mod_since_analyze": "1820404", + "n_tup_del": "0", + "n_tup_hot_upd": "888107", + "n_tup_ins": "6000000", + "n_tup_upd": "1820404", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "2893010", + "idx_tup_fetch": "2893010", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "294392", + "n_live_tup": "200", + "n_mod_since_analyze": "700587", + "n_tup_del": "0", + "n_tup_hot_upd": "915304", + "n_tup_ins": "200", + "n_tup_upd": "946604", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "2", + "idx_scan": "1747601", + "idx_tup_fetch": "3438090", + "last_autoanalyze": "2019-10-01 02:17:01.408756-04", + "last_autovacuum": "2019-10-01 02:16:34.128283-04", + "n_dead_tup": "252483", + "n_live_tup": "1781822", + "n_mod_since_analyze": "74494", + "n_tup_del": "873800", + "n_tup_hot_upd": "0", + "n_tup_ins": "2683463", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "1923506", + "idx_tup_fetch": "95956234", + "n_dead_tup": "7907329", + "n_live_tup": "69806810", + "n_mod_since_analyze": "78534607", + "n_tup_del": "0", + "n_tup_hot_upd": "1194152", + "n_tup_ins": "69806810", + "n_tup_upd": "8727797", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6946604", + "n_mod_since_analyze": "946604", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6946604", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "9917460", + "idx_tup_fetch": "9907685", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "107147747", + "idx_tup_fetch": "107147747", + "n_dead_tup": "7186256", + "n_live_tup": "20000000", + "n_mod_since_analyze": "29811367", + "n_tup_del": "0", + "n_tup_hot_upd": "4628880", + "n_tup_ins": "20000000", + "n_tup_upd": "9811367", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "12638073", + "idx_tup_fetch": "30638070", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "737688", + "n_live_tup": "6981605", + "n_mod_since_analyze": "1855405", + "n_tup_del": "0", + "n_tup_hot_upd": "162332", + "n_tup_ins": "6991380", + "n_tup_upd": "873800", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "4910754", + "idx_tup_fetch": "4910754", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "814139", + "n_live_tup": "1517", + "n_mod_since_analyze": "1432027", + "n_tup_del": "0", + "n_tup_hot_upd": "1538046", + "n_tup_ins": "2000", + "n_tup_upd": "1937984", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "81730190", + "heap_blks_read": "3826893", + "idx_blks_hit": "77340810", + "idx_blks_read": "563089", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "35557176", + "heap_blks_read": "225864", + "idx_blks_hit": "52398746", + "idx_blks_read": "1041628", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "9810192", + "heap_blks_read": "111073", + "idx_blks_hit": "19876537", + "idx_blks_read": "5706", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "3036721", + "heap_blks_read": "135731", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "355284616", + "heap_blks_read": "19062", + "idx_blks_hit": "7836064", + "idx_blks_read": "147", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "355308576", + "heap_blks_read": "15425265", + "idx_blks_hit": "337171920", + "idx_blks_read": "1780869", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "13849242", + "heap_blks_read": "336336", + "idx_blks_hit": "11208720", + "idx_blks_read": "188729", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "16358434", + "heap_blks_read": "4791323", + "idx_blks_hit": "24277099", + "idx_blks_read": "1116312", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "591442939", + "heap_blks_read": "45074", + "idx_blks_hit": "17420288", + "idx_blks_read": "1978", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4039854", + "blks_read": "255086", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1797406", + "tup_inserted": "0", + "tup_returned": "25042922", + "tup_updated": "14", + "xact_commit": "66626", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2010202155", + "blks_read": "29617569", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "873893", + "tup_fetched": "268480429", + "tup_inserted": "112531434", + "tup_returned": "1733882763", + "tup_updated": "24118077", + "xact_commit": "2192303", + "xact_rollback": "9781" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2796466", + "blks_read": "109976", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "954328", + "tup_inserted": "0", + "tup_returned": "21947197", + "tup_updated": "0", + "xact_commit": "52282", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1777040", + "blks_read": "67224", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "571292", + "tup_inserted": "0", + "tup_returned": "15678219", + "tup_updated": "13", + "xact_commit": "31747", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "4910754", + "idx_tup_fetch": "1136350", + "idx_tup_read": "531426625", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "2893010", + "idx_tup_fetch": "562721", + "idx_tup_read": "349933757", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "9917460", + "idx_tup_fetch": "9907685", + "idx_tup_read": "9907685", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "1747601", + "idx_tup_fetch": "3438090", + "idx_tup_read": "173484677", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "87724", + "idx_tup_fetch": "6087723", + "idx_tup_read": "6099099", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "620818", + "idx_tup_fetch": "2110053", + "idx_tup_read": "2777418", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "1923506", + "idx_tup_fetch": "95956234", + "idx_tup_read": "103606267", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "107147747", + "idx_tup_fetch": "80803051", + "idx_tup_read": "283252338", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "17420288", + "idx_blks_read": "1978", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "7836064", + "idx_blks_read": "147", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "19876537", + "idx_blks_read": "5706", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "11208720", + "idx_blks_read": "188729", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "4955109", + "idx_blks_read": "477432", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "5879883", + "idx_blks_read": "552145", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "77340810", + "idx_blks_read": "563089", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "337171920", + "idx_blks_read": "1780869", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/2__metrics_before.json b/integrationTests/data/2__metrics_before.json new file mode 100644 index 0000000..f376ce3 --- /dev/null +++ b/integrationTests/data/2__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3710134822", + "buffers_backend": "1747933752", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1842600953", + "buffers_clean": "90788870", + "checkpoint_sync_time": "13823109", + "checkpoint_write_time": "215037036", + "checkpoints_req": "9973", + "checkpoints_timed": "2925", + "maxwritten_clean": "291284", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "3277954", + "idx_tup_fetch": "10106838", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "965010", + "n_live_tup": "5999969", + "n_mod_since_analyze": "1014600", + "n_tup_del": "0", + "n_tup_hot_upd": "318435", + "n_tup_ins": "6000000", + "n_tup_upd": "1014600", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "1613061", + "idx_tup_fetch": "1613061", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "271565", + "n_live_tup": "200", + "n_mod_since_analyze": "281713", + "n_tup_del": "0", + "n_tup_hot_upd": "507758", + "n_tup_ins": "200", + "n_tup_upd": "527730", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "3", + "autovacuum_count": "1", + "idx_scan": "973741", + "idx_tup_fetch": "2665434", + "last_autoanalyze": "2019-10-01 02:12:02.541817-04", + "last_autovacuum": "2019-10-01 02:11:32.549937-04", + "n_dead_tup": "243887", + "n_live_tup": "1734588", + "n_mod_since_analyze": "0", + "n_tup_del": "486870", + "n_tup_hot_upd": "0", + "n_tup_ins": "2245024", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "1072431", + "idx_tup_fetch": "80107349", + "n_dead_tup": "4722627", + "n_live_tup": "65464051", + "n_mod_since_analyze": "70329908", + "n_tup_del": "0", + "n_tup_hot_upd": "217952", + "n_tup_ins": "65464051", + "n_tup_upd": "4865857", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6527730", + "n_mod_since_analyze": "527730", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6527730", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "5527670", + "idx_tup_fetch": "5522217", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "86340139", + "idx_tup_fetch": "86340139", + "n_dead_tup": "5165266", + "n_live_tup": "20000000", + "n_mod_since_analyze": "25468608", + "n_tup_del": "0", + "n_tup_hot_upd": "1564323", + "n_tup_ins": "20000000", + "n_tup_upd": "5468608", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "7044478", + "idx_tup_fetch": "25044475", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "468275", + "n_live_tup": "6547488", + "n_mod_since_analyze": "1034358", + "n_tup_del": "0", + "n_tup_hot_upd": "35122", + "n_tup_ins": "6552941", + "n_tup_upd": "486870", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "2738576", + "idx_tup_fetch": "2738576", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "652556", + "n_live_tup": "1517", + "n_mod_since_analyze": "579036", + "n_tup_del": "0", + "n_tup_hot_upd": "826407", + "n_tup_ins": "2000", + "n_tup_upd": "1080671", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "47600532", + "heap_blks_read": "3613672", + "idx_blks_hit": "44882844", + "idx_blks_read": "480525", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "22718802", + "heap_blks_read": "200074", + "idx_blks_hit": "29325100", + "idx_blks_read": "1002653", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "5422233", + "heap_blks_read": "109802", + "idx_blks_hit": "11076479", + "idx_blks_read": "5430", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "1748762", + "heap_blks_read": "131041", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "165598915", + "heap_blks_read": "11443", + "idx_blks_hit": "4011277", + "idx_blks_read": "93", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "256980512", + "heap_blks_read": "14898069", + "idx_blks_hit": "269773221", + "idx_blks_read": "1734008", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "4185610", + "heap_blks_read": "328988", + "idx_blks_hit": "5472711", + "idx_blks_read": "180520", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "8984646", + "heap_blks_read": "4509453", + "idx_blks_hit": "14337286", + "idx_blks_read": "1047309", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "349252015", + "heap_blks_read": "28095", + "idx_blks_hit": "8241650", + "idx_blks_read": "1473", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4038961", + "blks_read": "255028", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1796960", + "tup_inserted": "0", + "tup_returned": "25040470", + "tup_updated": "14", + "xact_commit": "66622", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1249820259", + "blks_read": "28284889", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "486963", + "tup_fetched": "214293549", + "tup_inserted": "106892923", + "tup_returned": "1161595798", + "tup_updated": "13444457", + "xact_commit": "1223242", + "xact_rollback": "5459" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2796263", + "blks_read": "109972", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "954295", + "tup_inserted": "0", + "tup_returned": "21944263", + "tup_updated": "0", + "xact_commit": "52276", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1776902", + "blks_read": "67224", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "571270", + "tup_inserted": "0", + "tup_returned": "15676263", + "tup_updated": "13", + "xact_commit": "31743", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "2738576", + "idx_tup_fetch": "1133850", + "idx_tup_read": "313211984", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "1613061", + "idx_tup_fetch": "562721", + "idx_tup_read": "162425405", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "5527670", + "idx_tup_fetch": "5522217", + "idx_tup_read": "5522217", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "973741", + "idx_tup_fetch": "2665434", + "idx_tup_read": "107537516", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "49187", + "idx_tup_fetch": "6049186", + "idx_tup_read": "6054095", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "345927", + "idx_tup_fetch": "1174812", + "idx_tup_read": "1559277", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "1072431", + "idx_tup_fetch": "80107349", + "idx_tup_read": "84804674", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "86340139", + "idx_tup_fetch": "59995443", + "idx_tup_read": "215788451", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "8241650", + "idx_blks_read": "1473", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "4011277", + "idx_blks_read": "93", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "11076479", + "idx_blks_read": "5430", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "5472711", + "idx_blks_read": "180520", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "2745572", + "idx_blks_read": "461708", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "3779668", + "idx_blks_read": "509864", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "44882844", + "idx_blks_read": "480525", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "269773221", + "idx_blks_read": "1734008", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/2__summary.json b/integrationTests/data/2__summary.json new file mode 100644 index 0000000..4ffd4e5 --- /dev/null +++ b/integrationTests/data/2__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569910354445, + "end_time": 1569910660810, + "observation_time": 306, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/3__knobs.json b/integrationTests/data/3__knobs.json new file mode 100644 index 0000000..3c0ffbd --- /dev/null +++ b/integrationTests/data/3__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "898", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.351067", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "20min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "1230", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "8GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "1", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "7GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "3.52188", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "1GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "654MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "325MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/3__metrics_after.json b/integrationTests/data/3__metrics_after.json new file mode 100644 index 0000000..20baa76 --- /dev/null +++ b/integrationTests/data/3__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3723804079", + "buffers_backend": "1753789281", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1844474445", + "buffers_clean": "91474924", + "checkpoint_sync_time": "13879648", + "checkpoint_write_time": "215313000", + "checkpoints_req": "9981", + "checkpoints_timed": "2925", + "maxwritten_clean": "292048", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "7841877", + "idx_tup_fetch": "15828396", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1508788", + "n_live_tup": "5999969", + "n_mod_since_analyze": "2429911", + "n_tup_del": "0", + "n_tup_hot_upd": "1348719", + "n_tup_ins": "6000000", + "n_tup_upd": "2429911", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "3857602", + "idx_tup_fetch": "3857602", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "268241", + "n_live_tup": "200", + "n_mod_since_analyze": "1016134", + "n_tup_del": "0", + "n_tup_hot_upd": "1221084", + "n_tup_ins": "200", + "n_tup_upd": "1262151", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "2", + "idx_scan": "2335521", + "idx_tup_fetch": "4024598", + "last_autoanalyze": "2019-10-01 02:17:01.408756-04", + "last_autovacuum": "2019-10-01 02:16:34.128283-04", + "n_dead_tup": "549745", + "n_live_tup": "1815245", + "n_mod_since_analyze": "695837", + "n_tup_del": "1167760", + "n_tup_hot_upd": "0", + "n_tup_ins": "3014148", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "2569717", + "idx_tup_fetch": "107945851", + "n_dead_tup": "10471753", + "n_live_tup": "73080489", + "n_mod_since_analyze": "84750036", + "n_tup_del": "0", + "n_tup_hot_upd": "1811876", + "n_tup_ins": "73080489", + "n_tup_upd": "11669547", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "7262151", + "n_mod_since_analyze": "1262151", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "7262151", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "13226863", + "idx_tup_fetch": "13213786", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "122812825", + "idx_tup_fetch": "122812825", + "n_dead_tup": "8353303", + "n_live_tup": "20000000", + "n_mod_since_analyze": "33085046", + "n_tup_del": "0", + "n_tup_hot_upd": "6999923", + "n_tup_ins": "20000000", + "n_tup_upd": "13085046", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "16859545", + "idx_tup_fetch": "34859542", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "969649", + "n_live_tup": "7308988", + "n_mod_since_analyze": "2476748", + "n_tup_del": "0", + "n_tup_hot_upd": "237605", + "n_tup_ins": "7322065", + "n_tup_upd": "1167760", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "6547868", + "idx_tup_fetch": "6547868", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "883728", + "n_live_tup": "1517", + "n_mod_since_analyze": "2074957", + "n_tup_del": "0", + "n_tup_hot_upd": "2058707", + "n_tup_ins": "2000", + "n_tup_upd": "2584216", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "107805659", + "heap_blks_read": "4380700", + "idx_blks_hit": "102359677", + "idx_blks_read": "688817", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "45250080", + "heap_blks_read": "305028", + "idx_blks_hit": "69028089", + "idx_blks_read": "2062812", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "13076602", + "heap_blks_read": "153577", + "idx_blks_hit": "26510748", + "idx_blks_read": "6514", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "4005628", + "heap_blks_read": "139936", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "487115101", + "heap_blks_read": "27186", + "idx_blks_hit": "10757530", + "idx_blks_read": "201", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "21435685", + "heap_blks_read": "374847", + "idx_blks_hit": "15662359", + "idx_blks_read": "332956", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "471642277", + "heap_blks_read": "21860983", + "idx_blks_hit": "386065285", + "idx_blks_read": "3025125", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "20179947", + "heap_blks_read": "6634912", + "idx_blks_hit": "30719429", + "idx_blks_read": "2011994", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "768494802", + "heap_blks_read": "70689", + "idx_blks_hit": "24400672", + "idx_blks_read": "2484", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4040717", + "blks_read": "255174", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1797852", + "tup_inserted": "0", + "tup_returned": "25045374", + "tup_updated": "14", + "xact_commit": "66630", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2604889385", + "blks_read": "42081595", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "1167858", + "tup_fetched": "309375598", + "tup_inserted": "116782035", + "tup_returned": "2196458027", + "tup_updated": "32198755", + "xact_commit": "2923103", + "xact_rollback": "13086" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2797526", + "blks_read": "110120", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "954867", + "tup_inserted": "0", + "tup_returned": "21950712", + "tup_updated": "0", + "xact_commit": "52294", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1777942", + "blks_read": "67342", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "571749", + "tup_inserted": "0", + "tup_returned": "15681649", + "tup_updated": "13", + "xact_commit": "31753", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "6547868", + "idx_tup_fetch": "1138850", + "idx_tup_read": "690582768", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "3857602", + "idx_tup_fetch": "562721", + "idx_tup_read": "480133743", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "13226863", + "idx_tup_fetch": "13213786", + "idx_tup_read": "13213786", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "2335521", + "idx_tup_fetch": "4024598", + "idx_tup_read": "222779201", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "116912", + "idx_tup_fetch": "6116911", + "idx_tup_read": "6133616", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "827568", + "idx_tup_fetch": "2814088", + "idx_tup_read": "3684596", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "2569717", + "idx_tup_fetch": "107945851", + "idx_tup_read": "117974195", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "122812825", + "idx_tup_fetch": "80803051", + "idx_tup_read": "381972224", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "24400672", + "idx_blks_read": "2484", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "10757530", + "idx_blks_read": "201", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "26510748", + "idx_blks_read": "6514", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "15662359", + "idx_blks_read": "332956", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "6189839", + "idx_blks_read": "992778", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "7054802", + "idx_blks_read": "869059", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "102359677", + "idx_blks_read": "688817", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "386065285", + "idx_blks_read": "3025125", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/3__metrics_before.json b/integrationTests/data/3__metrics_before.json new file mode 100644 index 0000000..63b11bb --- /dev/null +++ b/integrationTests/data/3__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3711468025", + "buffers_backend": "1748212498", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1844203395", + "buffers_clean": "90793826", + "checkpoint_sync_time": "13824085", + "checkpoint_write_time": "215237438", + "checkpoints_req": "9975", + "checkpoints_timed": "2925", + "maxwritten_clean": "291291", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "5879293", + "idx_tup_fetch": "13368527", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1305530", + "n_live_tup": "5999969", + "n_mod_since_analyze": "1820404", + "n_tup_del": "0", + "n_tup_hot_upd": "888107", + "n_tup_ins": "6000000", + "n_tup_upd": "1820404", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "2893010", + "idx_tup_fetch": "2893010", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "294392", + "n_live_tup": "200", + "n_mod_since_analyze": "700587", + "n_tup_del": "0", + "n_tup_hot_upd": "915304", + "n_tup_ins": "200", + "n_tup_upd": "946604", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "2", + "idx_scan": "1747601", + "idx_tup_fetch": "3438090", + "last_autoanalyze": "2019-10-01 02:17:01.408756-04", + "last_autovacuum": "2019-10-01 02:16:34.128283-04", + "n_dead_tup": "252483", + "n_live_tup": "1781822", + "n_mod_since_analyze": "74494", + "n_tup_del": "873800", + "n_tup_hot_upd": "0", + "n_tup_ins": "2683463", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "1923506", + "idx_tup_fetch": "95956234", + "n_dead_tup": "7907329", + "n_live_tup": "69806810", + "n_mod_since_analyze": "78534607", + "n_tup_del": "0", + "n_tup_hot_upd": "1194152", + "n_tup_ins": "69806810", + "n_tup_upd": "8727797", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "6946604", + "n_mod_since_analyze": "946604", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "6946604", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "9917460", + "idx_tup_fetch": "9907685", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "107147747", + "idx_tup_fetch": "107147747", + "n_dead_tup": "7186256", + "n_live_tup": "20000000", + "n_mod_since_analyze": "29811367", + "n_tup_del": "0", + "n_tup_hot_upd": "4628880", + "n_tup_ins": "20000000", + "n_tup_upd": "9811367", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "12638073", + "idx_tup_fetch": "30638070", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "737688", + "n_live_tup": "6981605", + "n_mod_since_analyze": "1855405", + "n_tup_del": "0", + "n_tup_hot_upd": "162332", + "n_tup_ins": "6991380", + "n_tup_upd": "873800", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "4910754", + "idx_tup_fetch": "4910754", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "814139", + "n_live_tup": "1517", + "n_mod_since_analyze": "1432027", + "n_tup_del": "0", + "n_tup_hot_upd": "1538046", + "n_tup_ins": "2000", + "n_tup_upd": "1937984", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "81731495", + "heap_blks_read": "3889556", + "idx_blks_hit": "77340810", + "idx_blks_read": "563089", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "35557176", + "heap_blks_read": "225864", + "idx_blks_hit": "52398746", + "idx_blks_read": "1041628", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "9810192", + "heap_blks_read": "111073", + "idx_blks_hit": "19876537", + "idx_blks_read": "5706", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "3036721", + "heap_blks_read": "135731", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "355284616", + "heap_blks_read": "19062", + "idx_blks_hit": "7836064", + "idx_blks_read": "147", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "13878952", + "heap_blks_read": "347557", + "idx_blks_hit": "11235530", + "idx_blks_read": "194324", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "355361854", + "heap_blks_read": "15467807", + "idx_blks_hit": "337171920", + "idx_blks_read": "1780869", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "16358434", + "heap_blks_read": "4791323", + "idx_blks_hit": "24277099", + "idx_blks_read": "1116312", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "591457953", + "heap_blks_read": "52364", + "idx_blks_hit": "17420288", + "idx_blks_read": "1978", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4039854", + "blks_read": "255086", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1797406", + "tup_inserted": "0", + "tup_returned": "25042922", + "tup_updated": "14", + "xact_commit": "66626", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2010330732", + "blks_read": "29746955", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "873898", + "tup_fetched": "268481993", + "tup_inserted": "112531439", + "tup_returned": "1733888758", + "tup_updated": "24118080", + "xact_commit": "2192324", + "xact_rollback": "9784" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2797409", + "blks_read": "110030", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "954834", + "tup_inserted": "0", + "tup_returned": "21947778", + "tup_updated": "0", + "xact_commit": "52288", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1777864", + "blks_read": "67282", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "571727", + "tup_inserted": "0", + "tup_returned": "15679693", + "tup_updated": "13", + "xact_commit": "31749", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "4910754", + "idx_tup_fetch": "1136350", + "idx_tup_read": "531426625", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "2893010", + "idx_tup_fetch": "562721", + "idx_tup_read": "349933757", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "9917460", + "idx_tup_fetch": "9907685", + "idx_tup_read": "9907685", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "1747601", + "idx_tup_fetch": "3438090", + "idx_tup_read": "173484677", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "87724", + "idx_tup_fetch": "6087723", + "idx_tup_read": "6099099", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "620818", + "idx_tup_fetch": "2110053", + "idx_tup_read": "2777418", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "1923506", + "idx_tup_fetch": "95956234", + "idx_tup_read": "103606267", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "107147747", + "idx_tup_fetch": "80803051", + "idx_tup_read": "283252338", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "17420288", + "idx_blks_read": "1978", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "7836064", + "idx_blks_read": "147", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "19876537", + "idx_blks_read": "5706", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "11235530", + "idx_blks_read": "194324", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "4955109", + "idx_blks_read": "477432", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "5879883", + "idx_blks_read": "552145", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "77340810", + "idx_blks_read": "563089", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "337171920", + "idx_blks_read": "1780869", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/3__summary.json b/integrationTests/data/3__summary.json new file mode 100644 index 0000000..2f00c5d --- /dev/null +++ b/integrationTests/data/3__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569910713049, + "end_time": 1569911018388, + "observation_time": 305, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/4__knobs.json b/integrationTests/data/4__knobs.json new file mode 100644 index 0000000..226052c --- /dev/null +++ b/integrationTests/data/4__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "495", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.641157", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "13min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "1371", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "14GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "8", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "2GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "7.49698", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "6GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "378MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "910MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/4__metrics_after.json b/integrationTests/data/4__metrics_after.json new file mode 100644 index 0000000..09b34af --- /dev/null +++ b/integrationTests/data/4__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3725204357", + "buffers_backend": "1753925047", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1847990679", + "buffers_clean": "91483599", + "checkpoint_sync_time": "13885983", + "checkpoint_write_time": "215581964", + "checkpoints_req": "10006", + "checkpoints_timed": "2925", + "maxwritten_clean": "292048", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "9350744", + "idx_tup_fetch": "17718591", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1592297", + "n_live_tup": "5999969", + "n_mod_since_analyze": "2898267", + "n_tup_del": "0", + "n_tup_hot_upd": "1749814", + "n_tup_ins": "6000000", + "n_tup_upd": "2898267", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "4599211", + "idx_tup_fetch": "4599211", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "196330", + "n_live_tup": "200", + "n_mod_since_analyze": "1258730", + "n_tup_del": "0", + "n_tup_hot_upd": "1457925", + "n_tup_ins": "200", + "n_tup_upd": "1504747", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "2787041", + "idx_tup_fetch": "4474585", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "442949", + "n_live_tup": "1859855", + "n_mod_since_analyze": "152831", + "n_tup_del": "1393520", + "n_tup_hot_upd": "0", + "n_tup_ins": "3268418", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "3066361", + "idx_tup_fetch": "117187254", + "n_dead_tup": "12314043", + "n_live_tup": "75596546", + "n_mod_since_analyze": "89523849", + "n_tup_del": "0", + "n_tup_hot_upd": "2481392", + "n_tup_ins": "75596546", + "n_tup_upd": "13927303", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "7504747", + "n_mod_since_analyze": "1504747", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "7504747", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "15769972", + "idx_tup_fetch": "15754399", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "134884116", + "idx_tup_fetch": "134884116", + "n_dead_tup": "8908219", + "n_live_tup": "20000000", + "n_mod_since_analyze": "35601103", + "n_tup_del": "0", + "n_tup_hot_upd": "9049018", + "n_tup_ins": "20000000", + "n_tup_upd": "15601103", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "20103989", + "idx_tup_fetch": "38103986", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1128125", + "n_live_tup": "7560762", + "n_mod_since_analyze": "2954282", + "n_tup_del": "0", + "n_tup_hot_upd": "319024", + "n_tup_ins": "7576335", + "n_tup_upd": "1393520", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "7806723", + "idx_tup_fetch": "7806723", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "842402", + "n_live_tup": "1517", + "n_mod_since_analyze": "2569327", + "n_tup_del": "0", + "n_tup_hot_upd": "2479691", + "n_tup_ins": "2000", + "n_tup_upd": "3081082", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "127288953", + "heap_blks_read": "4577677", + "idx_blks_hit": "120835888", + "idx_blks_read": "745220", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "52664446", + "heap_blks_read": "331239", + "idx_blks_hit": "82322233", + "idx_blks_read": "2118136", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "15618091", + "heap_blks_read": "154848", + "idx_blks_hit": "31608862", + "idx_blks_read": "6790", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "4749973", + "heap_blks_read": "142674", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "570794113", + "heap_blks_read": "32759", + "idx_blks_hit": "12999404", + "idx_blks_read": "255", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "553964356", + "heap_blks_read": "22513858", + "idx_blks_hit": "423959251", + "idx_blks_read": "3068894", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "26146036", + "heap_blks_read": "397454", + "idx_blks_hit": "19148220", + "idx_blks_read": "350060", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "23729158", + "heap_blks_read": "7016051", + "idx_blks_hit": "35934664", + "idx_blks_read": "2091539", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "843078075", + "heap_blks_read": "83155", + "idx_blks_hit": "29685440", + "idx_blks_read": "2989", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4041604", + "blks_read": "255238", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1798298", + "tup_inserted": "0", + "tup_returned": "25047826", + "tup_updated": "14", + "xact_commit": "66634", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2974994390", + "blks_read": "43637039", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "1393618", + "tup_fetched": "340879702", + "tup_inserted": "120049228", + "tup_returned": "2455362807", + "tup_updated": "38406146", + "xact_commit": "3485354", + "xact_rollback": "15585" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2798672", + "blks_read": "110178", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "955406", + "tup_inserted": "0", + "tup_returned": "21954227", + "tup_updated": "0", + "xact_commit": "52306", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1778898", + "blks_read": "67406", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "572206", + "tup_inserted": "0", + "tup_returned": "15685079", + "tup_updated": "13", + "xact_commit": "31759", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "7806723", + "idx_tup_fetch": "1141350", + "idx_tup_read": "757813812", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "4599211", + "idx_tup_fetch": "562721", + "idx_tup_read": "562968894", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "15769972", + "idx_tup_fetch": "15754399", + "idx_tup_read": "15754399", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "2787041", + "idx_tup_fetch": "4474585", + "idx_tup_read": "244586217", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "134884116", + "idx_tup_fetch": "80803051", + "idx_tup_read": "449995501", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "986540", + "idx_tup_fetch": "3354388", + "idx_tup_read": "4346082", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "3066361", + "idx_tup_fetch": "117187254", + "idx_tup_read": "128846957", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "29685440", + "idx_blks_read": "2989", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "12999404", + "idx_blks_read": "255", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "31608862", + "idx_blks_read": "6790", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "19148220", + "idx_blks_read": "350060", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "7044138", + "idx_blks_read": "957548", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "423959251", + "idx_blks_read": "3068894", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "7956728", + "idx_blks_read": "920696", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "120835888", + "idx_blks_read": "745220", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/4__metrics_before.json b/integrationTests/data/4__metrics_before.json new file mode 100644 index 0000000..054df35 --- /dev/null +++ b/integrationTests/data/4__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3723804436", + "buffers_backend": "1753789281", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1844474445", + "buffers_clean": "91475067", + "checkpoint_sync_time": "13879648", + "checkpoint_write_time": "215313000", + "checkpoints_req": "9981", + "checkpoints_timed": "2925", + "maxwritten_clean": "292048", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "7841877", + "idx_tup_fetch": "15828396", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1508788", + "n_live_tup": "5999969", + "n_mod_since_analyze": "2429911", + "n_tup_del": "0", + "n_tup_hot_upd": "1348719", + "n_tup_ins": "6000000", + "n_tup_upd": "2429911", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "3857602", + "idx_tup_fetch": "3857602", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "268241", + "n_live_tup": "200", + "n_mod_since_analyze": "1016134", + "n_tup_del": "0", + "n_tup_hot_upd": "1221084", + "n_tup_ins": "200", + "n_tup_upd": "1262151", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "2335521", + "idx_tup_fetch": "4024598", + "last_autoanalyze": "2019-10-01 02:17:01.408756-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "80232", + "n_live_tup": "1852500", + "n_mod_since_analyze": "695837", + "n_tup_del": "1167760", + "n_tup_hot_upd": "0", + "n_tup_ins": "3014148", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "2569717", + "idx_tup_fetch": "107945851", + "n_dead_tup": "10471753", + "n_live_tup": "73080489", + "n_mod_since_analyze": "84750036", + "n_tup_del": "0", + "n_tup_hot_upd": "1811876", + "n_tup_ins": "73080489", + "n_tup_upd": "11669547", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "7262151", + "n_mod_since_analyze": "1262151", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "7262151", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "13226863", + "idx_tup_fetch": "13213786", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "122812825", + "idx_tup_fetch": "122812825", + "n_dead_tup": "8353303", + "n_live_tup": "20000000", + "n_mod_since_analyze": "33085046", + "n_tup_del": "0", + "n_tup_hot_upd": "6999923", + "n_tup_ins": "20000000", + "n_tup_upd": "13085046", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "16859545", + "idx_tup_fetch": "34859542", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "969649", + "n_live_tup": "7308988", + "n_mod_since_analyze": "2476748", + "n_tup_del": "0", + "n_tup_hot_upd": "237605", + "n_tup_ins": "7322065", + "n_tup_upd": "1167760", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "6547868", + "idx_tup_fetch": "6547868", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "883728", + "n_live_tup": "1517", + "n_mod_since_analyze": "2074957", + "n_tup_del": "0", + "n_tup_hot_upd": "2058707", + "n_tup_ins": "2000", + "n_tup_upd": "2584216", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "107805666", + "heap_blks_read": "4437360", + "idx_blks_hit": "102359677", + "idx_blks_read": "688817", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "45250080", + "heap_blks_read": "305028", + "idx_blks_hit": "69028089", + "idx_blks_read": "2062812", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "13076602", + "heap_blks_read": "153577", + "idx_blks_hit": "26510748", + "idx_blks_read": "6514", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "4005628", + "heap_blks_read": "139936", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "487115101", + "heap_blks_read": "27186", + "idx_blks_hit": "10757530", + "idx_blks_read": "201", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "471684000", + "heap_blks_read": "21934282", + "idx_blks_hit": "386065285", + "idx_blks_read": "3025125", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "21452068", + "heap_blks_read": "389595", + "idx_blks_hit": "15688320", + "idx_blks_read": "343671", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "20179947", + "heap_blks_read": "6634912", + "idx_blks_hit": "30719429", + "idx_blks_read": "2011994", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "768494802", + "heap_blks_read": "70689", + "idx_blks_hit": "24400672", + "idx_blks_read": "2484", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4040717", + "blks_read": "255174", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1797852", + "tup_inserted": "0", + "tup_returned": "25045374", + "tup_updated": "14", + "xact_commit": "66630", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2604975520", + "blks_read": "42237362", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "1167858", + "tup_fetched": "309377017", + "tup_inserted": "116782035", + "tup_returned": "2196463986", + "tup_updated": "32198755", + "xact_commit": "2923122", + "xact_rollback": "13089" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2798469", + "blks_read": "110174", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "955373", + "tup_inserted": "0", + "tup_returned": "21951293", + "tup_updated": "0", + "xact_commit": "52300", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1778766", + "blks_read": "67400", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "572184", + "tup_inserted": "0", + "tup_returned": "15683123", + "tup_updated": "13", + "xact_commit": "31755", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "6547868", + "idx_tup_fetch": "1138850", + "idx_tup_read": "690582768", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "3857602", + "idx_tup_fetch": "562721", + "idx_tup_read": "480133743", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "13226863", + "idx_tup_fetch": "13213786", + "idx_tup_read": "13213786", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "2335521", + "idx_tup_fetch": "4024598", + "idx_tup_read": "222779201", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "122812825", + "idx_tup_fetch": "80803051", + "idx_tup_read": "381972224", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "827568", + "idx_tup_fetch": "2814088", + "idx_tup_read": "3684596", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "2569717", + "idx_tup_fetch": "107945851", + "idx_tup_read": "117974195", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "24400672", + "idx_blks_read": "2484", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "10757530", + "idx_blks_read": "201", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "26510748", + "idx_blks_read": "6514", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "15688320", + "idx_blks_read": "343671", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "5867440", + "idx_blks_read": "932469", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "386065285", + "idx_blks_read": "3025125", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "7054802", + "idx_blks_read": "869059", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "102359677", + "idx_blks_read": "688817", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/4__summary.json b/integrationTests/data/4__summary.json new file mode 100644 index 0000000..a7e4f76 --- /dev/null +++ b/integrationTests/data/4__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569911053776, + "end_time": 1569911357499, + "observation_time": 303, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/5__knobs.json b/integrationTests/data/5__knobs.json new file mode 100644 index 0000000..6c2f0b2 --- /dev/null +++ b/integrationTests/data/5__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "643", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.190656", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "7min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "1817", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "13GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "0", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "12GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "8.6807", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "5GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "209MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "572MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/5__metrics_after.json b/integrationTests/data/5__metrics_after.json new file mode 100644 index 0000000..a52b304 --- /dev/null +++ b/integrationTests/data/5__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3728070709", + "buffers_backend": "1754885456", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1849403048", + "buffers_clean": "91949018", + "checkpoint_sync_time": "13886522", + "checkpoint_write_time": "215638279", + "checkpoints_req": "10009", + "checkpoints_timed": "2925", + "maxwritten_clean": "292630", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "12204139", + "idx_tup_fetch": "21289456", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1616153", + "n_live_tup": "5999969", + "n_mod_since_analyze": "3784173", + "n_tup_del": "0", + "n_tup_hot_upd": "2611932", + "n_tup_ins": "6000000", + "n_tup_upd": "3784173", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "6002521", + "idx_tup_fetch": "6002521", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48341", + "n_live_tup": "200", + "n_mod_since_analyze": "1718556", + "n_tup_del": "0", + "n_tup_hot_upd": "1917751", + "n_tup_ins": "200", + "n_tup_upd": "1964573", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "3639201", + "idx_tup_fetch": "5326522", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "873916", + "n_live_tup": "1908226", + "n_mod_since_analyze": "1053362", + "n_tup_del": "1819600", + "n_tup_hot_upd": "0", + "n_tup_ins": "3747756", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "4004082", + "idx_tup_fetch": "134666460", + "n_dead_tup": "14331660", + "n_live_tup": "80341880", + "n_mod_since_analyze": "98527996", + "n_tup_del": "0", + "n_tup_hot_upd": "5384734", + "n_tup_ins": "80341880", + "n_tup_upd": "18186116", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "7964573", + "n_mod_since_analyze": "1964573", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "7964573", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "20568971", + "idx_tup_fetch": "20548511", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "157697925", + "idx_tup_fetch": "157697925", + "n_dead_tup": "8872210", + "n_live_tup": "20000000", + "n_mod_since_analyze": "40346437", + "n_tup_del": "0", + "n_tup_hot_upd": "13770053", + "n_tup_ins": "20000000", + "n_tup_upd": "20346437", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "26223713", + "idx_tup_fetch": "44223710", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1173273", + "n_live_tup": "8035213", + "n_mod_since_analyze": "3854813", + "n_tup_del": "0", + "n_tup_hot_upd": "715902", + "n_tup_ins": "8055673", + "n_tup_upd": "1819600", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "10187546", + "idx_tup_fetch": "10187546", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602411", + "n_live_tup": "1517", + "n_mod_since_analyze": "3503604", + "n_tup_del": "0", + "n_tup_hot_upd": "3418855", + "n_tup_ins": "2000", + "n_tup_upd": "4020246", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "157573734", + "heap_blks_read": "4864072", + "idx_blks_hit": "149112774", + "idx_blks_read": "854306", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "65905620", + "heap_blks_read": "379821", + "idx_blks_hit": "105092786", + "idx_blks_read": "2326357", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "20415243", + "heap_blks_read": "156128", + "idx_blks_hit": "41229597", + "idx_blks_read": "7066", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "6165378", + "heap_blks_read": "147866", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "734620394", + "heap_blks_read": "34983", + "idx_blks_hit": "17208443", + "idx_blks_read": "309", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "697834205", + "heap_blks_read": "23668970", + "idx_blks_hit": "492988845", + "idx_blks_read": "3128846", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "28904386", + "heap_blks_read": "418189", + "idx_blks_hit": "27125082", + "idx_blks_read": "361369", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "29373255", + "heap_blks_read": "7930250", + "idx_blks_hit": "44948804", + "idx_blks_read": "2262246", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "867222976", + "heap_blks_read": "121031", + "idx_blks_hit": "39113887", + "idx_blks_read": "3494", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4042467", + "blks_read": "255326", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1798744", + "tup_inserted": "0", + "tup_returned": "25050278", + "tup_updated": "14", + "xact_commit": "66638", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "3525387908", + "blks_read": "46669199", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "1819703", + "tup_fetched": "400358016", + "tup_inserted": "126213069", + "tup_returned": "2800511378", + "tup_updated": "50121272", + "xact_commit": "4547982", + "xact_rollback": "20475" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2799784", + "blks_read": "110270", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "955945", + "tup_inserted": "0", + "tup_returned": "21957742", + "tup_updated": "0", + "xact_commit": "52318", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1779824", + "blks_read": "67500", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "572663", + "tup_inserted": "0", + "tup_returned": "15688509", + "tup_updated": "13", + "xact_commit": "31765", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "10187546", + "idx_tup_fetch": "1143850", + "idx_tup_read": "779144830", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "6002521", + "idx_tup_fetch": "562721", + "idx_tup_read": "725873529", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "20568971", + "idx_tup_fetch": "20548511", + "idx_tup_read": "20548511", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "3639201", + "idx_tup_fetch": "5326522", + "idx_tup_read": "246028015", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "157697925", + "idx_tup_fetch": "80803051", + "idx_tup_read": "575771144", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "1288026", + "idx_tup_fetch": "4373344", + "idx_tup_read": "5486817", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "4004082", + "idx_tup_fetch": "134666460", + "idx_tup_read": "147755692", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "39113887", + "idx_blks_read": "3494", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "17208443", + "idx_blks_read": "309", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "41229597", + "idx_blks_read": "7066", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "27125082", + "idx_blks_read": "361369", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "8473931", + "idx_blks_read": "1059874", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "492988845", + "idx_blks_read": "3128846", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "9198510", + "idx_blks_read": "1044089", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "149112774", + "idx_blks_read": "854306", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/5__metrics_before.json b/integrationTests/data/5__metrics_before.json new file mode 100644 index 0000000..a5ee96c --- /dev/null +++ b/integrationTests/data/5__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3725204616", + "buffers_backend": "1753925047", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1847990679", + "buffers_clean": "91483600", + "checkpoint_sync_time": "13885983", + "checkpoint_write_time": "215581964", + "checkpoints_req": "10006", + "checkpoints_timed": "2925", + "maxwritten_clean": "292048", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "9350744", + "idx_tup_fetch": "17718591", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1592297", + "n_live_tup": "5999969", + "n_mod_since_analyze": "2898267", + "n_tup_del": "0", + "n_tup_hot_upd": "1749814", + "n_tup_ins": "6000000", + "n_tup_upd": "2898267", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "4599211", + "idx_tup_fetch": "4599211", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "196330", + "n_live_tup": "200", + "n_mod_since_analyze": "1258730", + "n_tup_del": "0", + "n_tup_hot_upd": "1457925", + "n_tup_ins": "200", + "n_tup_upd": "1504747", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "2787041", + "idx_tup_fetch": "4474585", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "442949", + "n_live_tup": "1859855", + "n_mod_since_analyze": "152831", + "n_tup_del": "1393520", + "n_tup_hot_upd": "0", + "n_tup_ins": "3268418", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "3066361", + "idx_tup_fetch": "117187254", + "n_dead_tup": "12314043", + "n_live_tup": "75596546", + "n_mod_since_analyze": "89523849", + "n_tup_del": "0", + "n_tup_hot_upd": "2481392", + "n_tup_ins": "75596546", + "n_tup_upd": "13927303", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "7504747", + "n_mod_since_analyze": "1504747", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "7504747", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "15769972", + "idx_tup_fetch": "15754399", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "134884116", + "idx_tup_fetch": "134884116", + "n_dead_tup": "8908219", + "n_live_tup": "20000000", + "n_mod_since_analyze": "35601103", + "n_tup_del": "0", + "n_tup_hot_upd": "9049018", + "n_tup_ins": "20000000", + "n_tup_upd": "15601103", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "20103989", + "idx_tup_fetch": "38103986", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1128125", + "n_live_tup": "7560762", + "n_mod_since_analyze": "2954282", + "n_tup_del": "0", + "n_tup_hot_upd": "319024", + "n_tup_ins": "7576335", + "n_tup_upd": "1393520", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "7806723", + "idx_tup_fetch": "7806723", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "842402", + "n_live_tup": "1517", + "n_mod_since_analyze": "2569327", + "n_tup_del": "0", + "n_tup_hot_upd": "2479691", + "n_tup_ins": "2000", + "n_tup_upd": "3081082", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "127289100", + "heap_blks_read": "4630489", + "idx_blks_hit": "120835888", + "idx_blks_read": "745220", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "52664446", + "heap_blks_read": "331239", + "idx_blks_hit": "82322233", + "idx_blks_read": "2118136", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "15618091", + "heap_blks_read": "154848", + "idx_blks_hit": "31608862", + "idx_blks_read": "6790", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "4749973", + "heap_blks_read": "142674", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "570794113", + "heap_blks_read": "32759", + "idx_blks_hit": "12999404", + "idx_blks_read": "255", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "554025221", + "heap_blks_read": "22586613", + "idx_blks_hit": "423959251", + "idx_blks_read": "3068894", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "26150746", + "heap_blks_read": "405377", + "idx_blks_hit": "19148220", + "idx_blks_read": "350060", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "23729158", + "heap_blks_read": "7016051", + "idx_blks_hit": "35934664", + "idx_blks_read": "2091539", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "843084212", + "heap_blks_read": "116085", + "idx_blks_hit": "29685944", + "idx_blks_read": "2989", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4041604", + "blks_read": "255238", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1798298", + "tup_inserted": "0", + "tup_returned": "25047826", + "tup_updated": "14", + "xact_commit": "66634", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2975069025", + "blks_read": "43803645", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "1393623", + "tup_fetched": "340881140", + "tup_inserted": "120049233", + "tup_returned": "2455369461", + "tup_updated": "38406149", + "xact_commit": "3485374", + "xact_rollback": "15588" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2799615", + "blks_read": "110232", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "955912", + "tup_inserted": "0", + "tup_returned": "21954808", + "tup_updated": "0", + "xact_commit": "52312", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1779722", + "blks_read": "67464", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "572641", + "tup_inserted": "0", + "tup_returned": "15686553", + "tup_updated": "13", + "xact_commit": "31761", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "7806723", + "idx_tup_fetch": "1141350", + "idx_tup_read": "757813812", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "4599211", + "idx_tup_fetch": "562721", + "idx_tup_read": "562968894", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "15769972", + "idx_tup_fetch": "15754399", + "idx_tup_read": "15754399", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "2787041", + "idx_tup_fetch": "4474585", + "idx_tup_read": "244586217", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "134884116", + "idx_tup_fetch": "80803051", + "idx_tup_read": "449995501", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "986540", + "idx_tup_fetch": "3354388", + "idx_tup_read": "4346082", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "3066361", + "idx_tup_fetch": "117187254", + "idx_tup_read": "128846957", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "29685944", + "idx_blks_read": "2989", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "12999404", + "idx_blks_read": "255", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "31608862", + "idx_blks_read": "6790", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "19148220", + "idx_blks_read": "350060", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "7044138", + "idx_blks_read": "957548", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "423959251", + "idx_blks_read": "3068894", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "7956728", + "idx_blks_read": "920696", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "120835888", + "idx_blks_read": "745220", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/5__summary.json b/integrationTests/data/5__summary.json new file mode 100644 index 0000000..debbb8e --- /dev/null +++ b/integrationTests/data/5__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569911394879, + "end_time": 1569911702048, + "observation_time": 307, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/6__knobs.json b/integrationTests/data/6__knobs.json new file mode 100644 index 0000000..4f4737f --- /dev/null +++ b/integrationTests/data/6__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "11", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.808417", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "24min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "758", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "11GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "5", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "8GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "2.42393", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "10GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "548MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "78MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/6__metrics_after.json b/integrationTests/data/6__metrics_after.json new file mode 100644 index 0000000..60b7350 --- /dev/null +++ b/integrationTests/data/6__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3729496916", + "buffers_backend": "1755068650", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1852325921", + "buffers_clean": "91953630", + "checkpoint_sync_time": "13888610", + "checkpoint_write_time": "215859128", + "checkpoints_req": "10015", + "checkpoints_timed": "2925", + "maxwritten_clean": "292846", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "15148346", + "idx_tup_fetch": "24980248", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1654074", + "n_live_tup": "5999969", + "n_mod_since_analyze": "4699350", + "n_tup_del": "0", + "n_tup_hot_upd": "3506347", + "n_tup_ins": "6000000", + "n_tup_upd": "4699350", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "7449085", + "idx_tup_fetch": "7449085", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48236", + "n_live_tup": "200", + "n_mod_since_analyze": "2192053", + "n_tup_del": "0", + "n_tup_hot_upd": "2391248", + "n_tup_ins": "200", + "n_tup_upd": "2438070", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "4522561", + "idx_tup_fetch": "6209635", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "1320602", + "n_live_tup": "1956750", + "n_mod_since_analyze": "1985246", + "n_tup_del": "2261280", + "n_tup_hot_upd": "0", + "n_tup_ins": "4242966", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "4975027", + "idx_tup_fetch": "152662767", + "n_dead_tup": "16229019", + "n_live_tup": "85243169", + "n_mod_since_analyze": "107846620", + "n_tup_del": "0", + "n_tup_hot_upd": "8440096", + "n_tup_ins": "85243169", + "n_tup_upd": "22603451", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "8438070", + "n_mod_since_analyze": "2438070", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "8438070", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "25524676", + "idx_tup_fetch": "25499210", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "181169599", + "idx_tup_fetch": "181169599", + "n_dead_tup": "9003487", + "n_live_tup": "20000000", + "n_mod_since_analyze": "45247726", + "n_tup_del": "0", + "n_tup_hot_upd": "18651286", + "n_tup_ins": "20000000", + "n_tup_upd": "25247726", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "32547545", + "idx_tup_fetch": "50547542", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1210700", + "n_live_tup": "8525417", + "n_mod_since_analyze": "4786697", + "n_tup_del": "0", + "n_tup_hot_upd": "1124771", + "n_tup_ins": "8550883", + "n_tup_upd": "2261280", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "12642069", + "idx_tup_fetch": "12642069", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602285", + "n_live_tup": "1517", + "n_mod_since_analyze": "4467305", + "n_tup_del": "0", + "n_tup_hot_upd": "4387562", + "n_tup_ins": "2000", + "n_tup_upd": "4988953", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "188806611", + "heap_blks_read": "5100315", + "idx_blks_hit": "178190228", + "idx_blks_read": "950774", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "79615354", + "heap_blks_read": "409921", + "idx_blks_hit": "128801801", + "idx_blks_read": "2385900", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "25369031", + "heap_blks_read": "157399", + "idx_blks_hit": "51164627", + "idx_blks_read": "7342", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "7623127", + "heap_blks_read": "153174", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "903522367", + "heap_blks_read": "37207", + "idx_blks_hit": "21548099", + "idx_blks_read": "363", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "845284908", + "heap_blks_read": "24327154", + "idx_blks_hit": "564005506", + "idx_blks_read": "3177054", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "31741851", + "heap_blks_read": "439044", + "idx_blks_hit": "34486160", + "idx_blks_read": "382363", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "35700379", + "heap_blks_read": "8240169", + "idx_blks_hit": "54265888", + "idx_blks_read": "2332165", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "872592503", + "heap_blks_read": "123743", + "idx_blks_hit": "48832773", + "idx_blks_read": "3999", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4043360", + "blks_read": "255384", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1799190", + "tup_inserted": "0", + "tup_returned": "25052730", + "tup_updated": "14", + "xact_commit": "66642", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4072189044", + "blks_read": "48232492", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "2261383", + "tup_fetched": "461639891", + "tup_inserted": "132578275", + "tup_returned": "3135078114", + "tup_updated": "62238957", + "xact_commit": "5643616", + "xact_rollback": "25484" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2800930", + "blks_read": "110328", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "956484", + "tup_inserted": "0", + "tup_returned": "21961257", + "tup_updated": "0", + "xact_commit": "52330", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1780786", + "blks_read": "67558", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "573120", + "tup_inserted": "0", + "tup_returned": "15691939", + "tup_updated": "13", + "xact_commit": "31771", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "12642069", + "idx_tup_fetch": "1146350", + "idx_tup_read": "781610948", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "7449085", + "idx_tup_fetch": "562721", + "idx_tup_read": "893826457", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "25524676", + "idx_tup_fetch": "25499210", + "idx_tup_read": "25499210", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "4522561", + "idx_tup_fetch": "6209635", + "idx_tup_read": "247370671", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "226374", + "idx_tup_fetch": "6226373", + "idx_tup_read": "6259141", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "1598403", + "idx_tup_fetch": "5430306", + "idx_tup_read": "6612718", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "4975027", + "idx_tup_fetch": "152662767", + "idx_tup_read": "167175549", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "181169599", + "idx_tup_fetch": "80803051", + "idx_tup_read": "704013133", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "48832773", + "idx_blks_read": "3999", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "21548099", + "idx_blks_read": "363", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "51164627", + "idx_blks_read": "7342", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "34486160", + "idx_blks_read": "382363", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "10715025", + "idx_blks_read": "1136939", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "10525099", + "idx_blks_read": "1086753", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "178190228", + "idx_blks_read": "950774", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "564005506", + "idx_blks_read": "3177054", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/6__metrics_before.json b/integrationTests/data/6__metrics_before.json new file mode 100644 index 0000000..919b1da --- /dev/null +++ b/integrationTests/data/6__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3728071053", + "buffers_backend": "1754888262", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1849432214", + "buffers_clean": "91951085", + "checkpoint_sync_time": "13886564", + "checkpoint_write_time": "215674939", + "checkpoints_req": "10009", + "checkpoints_timed": "2925", + "maxwritten_clean": "292630", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "12204139", + "idx_tup_fetch": "21289456", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1616153", + "n_live_tup": "5999969", + "n_mod_since_analyze": "3784173", + "n_tup_del": "0", + "n_tup_hot_upd": "2611932", + "n_tup_ins": "6000000", + "n_tup_upd": "3784173", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "6002521", + "idx_tup_fetch": "6002521", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48341", + "n_live_tup": "200", + "n_mod_since_analyze": "1718556", + "n_tup_del": "0", + "n_tup_hot_upd": "1917751", + "n_tup_ins": "200", + "n_tup_upd": "1964573", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "3639201", + "idx_tup_fetch": "5326522", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "873916", + "n_live_tup": "1908226", + "n_mod_since_analyze": "1053362", + "n_tup_del": "1819600", + "n_tup_hot_upd": "0", + "n_tup_ins": "3747756", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "4004082", + "idx_tup_fetch": "134666460", + "n_dead_tup": "14331660", + "n_live_tup": "80341880", + "n_mod_since_analyze": "98527996", + "n_tup_del": "0", + "n_tup_hot_upd": "5384734", + "n_tup_ins": "80341880", + "n_tup_upd": "18186116", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "7964573", + "n_mod_since_analyze": "1964573", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "7964573", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "20568971", + "idx_tup_fetch": "20548511", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "157697925", + "idx_tup_fetch": "157697925", + "n_dead_tup": "8872210", + "n_live_tup": "20000000", + "n_mod_since_analyze": "40346437", + "n_tup_del": "0", + "n_tup_hot_upd": "13770053", + "n_tup_ins": "20000000", + "n_tup_upd": "20346437", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "26223713", + "idx_tup_fetch": "44223710", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1173273", + "n_live_tup": "8035213", + "n_mod_since_analyze": "3854813", + "n_tup_del": "0", + "n_tup_hot_upd": "715902", + "n_tup_ins": "8055673", + "n_tup_upd": "1819600", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "10187546", + "idx_tup_fetch": "10187546", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602411", + "n_live_tup": "1517", + "n_mod_since_analyze": "3503604", + "n_tup_del": "0", + "n_tup_hot_upd": "3418855", + "n_tup_ins": "2000", + "n_tup_upd": "4020246", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "157600565", + "heap_blks_read": "4892740", + "idx_blks_hit": "149112774", + "idx_blks_read": "854306", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "65905620", + "heap_blks_read": "379821", + "idx_blks_hit": "105092786", + "idx_blks_read": "2326357", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "20415243", + "heap_blks_read": "156128", + "idx_blks_hit": "41229597", + "idx_blks_read": "7066", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "6165378", + "heap_blks_read": "147866", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "734620394", + "heap_blks_read": "34983", + "idx_blks_hit": "17208443", + "idx_blks_read": "309", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "697898637", + "heap_blks_read": "23752833", + "idx_blks_hit": "492988845", + "idx_blks_read": "3128846", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "28915593", + "heap_blks_read": "431907", + "idx_blks_hit": "27170601", + "idx_blks_read": "372540", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "29373255", + "heap_blks_read": "7930250", + "idx_blks_hit": "44948804", + "idx_blks_read": "2262246", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "867222976", + "heap_blks_read": "121031", + "idx_blks_hit": "39113887", + "idx_blks_read": "3494", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4042467", + "blks_read": "255326", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1798744", + "tup_inserted": "0", + "tup_returned": "25050278", + "tup_updated": "14", + "xact_commit": "66638", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "3525537711", + "blks_read": "46806880", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "1819703", + "tup_fetched": "400359127", + "tup_inserted": "126213069", + "tup_returned": "2800517705", + "tup_updated": "50121272", + "xact_commit": "4548000", + "xact_rollback": "20478" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2800727", + "blks_read": "110324", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "956451", + "tup_inserted": "0", + "tup_returned": "21958323", + "tup_updated": "0", + "xact_commit": "52324", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1780648", + "blks_read": "67558", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "573098", + "tup_inserted": "0", + "tup_returned": "15689983", + "tup_updated": "13", + "xact_commit": "31767", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "10187546", + "idx_tup_fetch": "1143850", + "idx_tup_read": "779144830", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "6002521", + "idx_tup_fetch": "562721", + "idx_tup_read": "725873529", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "20568971", + "idx_tup_fetch": "20548511", + "idx_tup_read": "20548511", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "3639201", + "idx_tup_fetch": "5326522", + "idx_tup_read": "246028015", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "182401", + "idx_tup_fetch": "6182400", + "idx_tup_read": "6210043", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "1288026", + "idx_tup_fetch": "4373344", + "idx_tup_read": "5486817", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "4004082", + "idx_tup_fetch": "134666460", + "idx_tup_read": "147755692", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "157697925", + "idx_tup_fetch": "80803051", + "idx_tup_read": "575771144", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "39113887", + "idx_blks_read": "3494", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "17208443", + "idx_blks_read": "309", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "41229597", + "idx_blks_read": "7066", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "27170601", + "idx_blks_read": "372540", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "9011561", + "idx_blks_read": "1111487", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "9198510", + "idx_blks_read": "1044089", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "149112774", + "idx_blks_read": "854306", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "492988845", + "idx_blks_read": "3128846", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/6__summary.json b/integrationTests/data/6__summary.json new file mode 100644 index 0000000..c42f63a --- /dev/null +++ b/integrationTests/data/6__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569911740145, + "end_time": 1569912047127, + "observation_time": 306, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/7__knobs.json b/integrationTests/data/7__knobs.json new file mode 100644 index 0000000..a5f00c4 --- /dev/null +++ b/integrationTests/data/7__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "249", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.273329", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "10min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "351", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "6GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "4", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "13GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "6.06508", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "8GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "990MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "638MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/7__metrics_after.json b/integrationTests/data/7__metrics_after.json new file mode 100644 index 0000000..2716728 --- /dev/null +++ b/integrationTests/data/7__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3731260087", + "buffers_backend": "1755258665", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1854658367", + "buffers_clean": "92070147", + "checkpoint_sync_time": "13889272", + "checkpoint_write_time": "216007885", + "checkpoints_req": "10018", + "checkpoints_timed": "2925", + "maxwritten_clean": "293092", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "18755546", + "idx_tup_fetch": "29497879", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1688815", + "n_live_tup": "5999969", + "n_mod_since_analyze": "5817506", + "n_tup_del": "0", + "n_tup_hot_upd": "4602553", + "n_tup_ins": "6000000", + "n_tup_upd": "5817506", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "9223033", + "idx_tup_fetch": "9223033", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48276", + "n_live_tup": "200", + "n_mod_since_analyze": "2772169", + "n_tup_del": "0", + "n_tup_hot_upd": "2971364", + "n_tup_ins": "200", + "n_tup_upd": "3018186", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "5598641", + "idx_tup_fetch": "7285271", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "1864742", + "n_live_tup": "2020940", + "n_mod_since_analyze": "3125516", + "n_tup_del": "2799320", + "n_tup_hot_upd": "0", + "n_tup_ins": "4851296", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "6158880", + "idx_tup_fetch": "174761547", + "n_dead_tup": "18397532", + "n_live_tup": "91267523", + "n_mod_since_analyze": "119253678", + "n_tup_del": "0", + "n_tup_hot_upd": "12246846", + "n_tup_ins": "91267523", + "n_tup_upd": "27986155", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "9018186", + "n_mod_since_analyze": "3018186", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "9018186", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "31615435", + "idx_tup_fetch": "31583869", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "210092170", + "idx_tup_fetch": "210092170", + "n_dead_tup": "9101146", + "n_live_tup": "20000000", + "n_mod_since_analyze": "51272080", + "n_tup_del": "0", + "n_tup_hot_upd": "24654245", + "n_tup_ins": "20000000", + "n_tup_upd": "31272080", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "40310135", + "idx_tup_fetch": "58310132", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1255940", + "n_live_tup": "9127647", + "n_mod_since_analyze": "5926967", + "n_tup_del": "0", + "n_tup_hot_upd": "1623735", + "n_tup_ins": "9159213", + "n_tup_upd": "2799320", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "15653024", + "idx_tup_fetch": "15653024", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602434", + "n_live_tup": "1517", + "n_mod_since_analyze": "5649651", + "n_tup_del": "0", + "n_tup_hot_upd": "5576008", + "n_tup_ins": "2000", + "n_tup_upd": "6177399", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "226668153", + "heap_blks_read": "5386817", + "idx_blks_hit": "213493860", + "idx_blks_read": "1074326", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "96434300", + "heap_blks_read": "452170", + "idx_blks_hit": "157896981", + "idx_blks_read": "2462191", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "31457805", + "heap_blks_read": "158670", + "idx_blks_hit": "63375363", + "idx_blks_read": "7618", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "9403065", + "heap_blks_read": "159682", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "1110665510", + "heap_blks_read": "39431", + "idx_blks_hit": "26870183", + "idx_blks_read": "417", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "1026087602", + "heap_blks_read": "25074882", + "idx_blks_hit": "651507827", + "idx_blks_read": "3232267", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "35220627", + "heap_blks_read": "457561", + "idx_blks_hit": "43581079", + "idx_blks_read": "405761", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "43348672", + "heap_blks_read": "8667459", + "idx_blks_hit": "65624009", + "idx_blks_read": "2430479", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "879168732", + "heap_blks_read": "123807", + "idx_blks_hit": "60754817", + "idx_blks_read": "4504", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4044253", + "blks_read": "255442", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1799636", + "tup_inserted": "0", + "tup_returned": "25055182", + "tup_updated": "14", + "xact_commit": "66646", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4742281934", + "blks_read": "50142790", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "2799423", + "tup_fetched": "536951038", + "tup_inserted": "140399405", + "tup_returned": "3545127032", + "tup_updated": "77070773", + "xact_commit": "6987719", + "xact_rollback": "31587" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2802076", + "blks_read": "110386", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "957023", + "tup_inserted": "0", + "tup_returned": "21964772", + "tup_updated": "0", + "xact_commit": "52342", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1781748", + "blks_read": "67616", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "573577", + "tup_inserted": "0", + "tup_returned": "15695369", + "tup_updated": "13", + "xact_commit": "31777", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "15653024", + "idx_tup_fetch": "1148850", + "idx_tup_read": "784621903", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "9223033", + "idx_tup_fetch": "562721", + "idx_tup_read": "1099806305", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "31615435", + "idx_tup_fetch": "31583869", + "idx_tup_read": "31583869", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "5598641", + "idx_tup_fetch": "7285271", + "idx_tup_read": "249003622", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "210092170", + "idx_tup_fetch": "80803051", + "idx_tup_read": "861170444", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "1978150", + "idx_tup_fetch": "6720484", + "idx_tup_read": "7959194", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "6158880", + "idx_tup_fetch": "174761547", + "idx_tup_read": "190916985", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "60754817", + "idx_blks_read": "4504", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "26870183", + "idx_blks_read": "417", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "63375363", + "idx_blks_read": "7618", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "43581079", + "idx_blks_read": "405761", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "11960564", + "idx_blks_read": "1118998", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "651507827", + "idx_blks_read": "3232267", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "12112080", + "idx_blks_read": "1151702", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "213493860", + "idx_blks_read": "1074326", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/7__metrics_before.json b/integrationTests/data/7__metrics_before.json new file mode 100644 index 0000000..13521c1 --- /dev/null +++ b/integrationTests/data/7__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3729497112", + "buffers_backend": "1755071354", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1852394801", + "buffers_clean": "91953630", + "checkpoint_sync_time": "13888656", + "checkpoint_write_time": "215908394", + "checkpoints_req": "10015", + "checkpoints_timed": "2925", + "maxwritten_clean": "292846", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "15148346", + "idx_tup_fetch": "24980248", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1654074", + "n_live_tup": "5999969", + "n_mod_since_analyze": "4699350", + "n_tup_del": "0", + "n_tup_hot_upd": "3506347", + "n_tup_ins": "6000000", + "n_tup_upd": "4699350", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "7449085", + "idx_tup_fetch": "7449085", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48236", + "n_live_tup": "200", + "n_mod_since_analyze": "2192053", + "n_tup_del": "0", + "n_tup_hot_upd": "2391248", + "n_tup_ins": "200", + "n_tup_upd": "2438070", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "4522561", + "idx_tup_fetch": "6209635", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "1320602", + "n_live_tup": "1956750", + "n_mod_since_analyze": "1985246", + "n_tup_del": "2261280", + "n_tup_hot_upd": "0", + "n_tup_ins": "4242966", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "4975027", + "idx_tup_fetch": "152662767", + "n_dead_tup": "16229019", + "n_live_tup": "85243169", + "n_mod_since_analyze": "107846620", + "n_tup_del": "0", + "n_tup_hot_upd": "8440096", + "n_tup_ins": "85243169", + "n_tup_upd": "22603451", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "8438070", + "n_mod_since_analyze": "2438070", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "8438070", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "25524676", + "idx_tup_fetch": "25499210", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "181169599", + "idx_tup_fetch": "181169599", + "n_dead_tup": "9003487", + "n_live_tup": "20000000", + "n_mod_since_analyze": "45247726", + "n_tup_del": "0", + "n_tup_hot_upd": "18651286", + "n_tup_ins": "20000000", + "n_tup_upd": "25247726", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "32547545", + "idx_tup_fetch": "50547542", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1210700", + "n_live_tup": "8525417", + "n_mod_since_analyze": "4786697", + "n_tup_del": "0", + "n_tup_hot_upd": "1124771", + "n_tup_ins": "8550883", + "n_tup_upd": "2261280", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "12642069", + "idx_tup_fetch": "12642069", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602285", + "n_live_tup": "1517", + "n_mod_since_analyze": "4467305", + "n_tup_del": "0", + "n_tup_hot_upd": "4387562", + "n_tup_ins": "2000", + "n_tup_upd": "4988953", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "188843161", + "heap_blks_read": "5140172", + "idx_blks_hit": "178190228", + "idx_blks_read": "950774", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "79615354", + "heap_blks_read": "409921", + "idx_blks_hit": "128801801", + "idx_blks_read": "2385900", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "25369031", + "heap_blks_read": "157399", + "idx_blks_hit": "51164627", + "idx_blks_read": "7342", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "7623127", + "heap_blks_read": "153174", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "903522367", + "heap_blks_read": "37207", + "idx_blks_hit": "21548099", + "idx_blks_read": "363", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "845365404", + "heap_blks_read": "24411313", + "idx_blks_hit": "564005506", + "idx_blks_read": "3177054", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "31755621", + "heap_blks_read": "450397", + "idx_blks_hit": "34530433", + "idx_blks_read": "394518", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "35700379", + "heap_blks_read": "8240169", + "idx_blks_hit": "54265888", + "idx_blks_read": "2332165", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "872592503", + "heap_blks_read": "123743", + "idx_blks_hit": "48832773", + "idx_blks_read": "3999", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4043360", + "blks_read": "255384", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1799190", + "tup_inserted": "0", + "tup_returned": "25052730", + "tup_updated": "14", + "xact_commit": "66642", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4072366195", + "blks_read": "48380089", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "2261383", + "tup_fetched": "461641026", + "tup_inserted": "132578275", + "tup_returned": "3135083451", + "tup_updated": "62238957", + "xact_commit": "5643634", + "xact_rollback": "25487" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2801873", + "blks_read": "110382", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "956990", + "tup_inserted": "0", + "tup_returned": "21961838", + "tup_updated": "0", + "xact_commit": "52336", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1781610", + "blks_read": "67616", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "573555", + "tup_inserted": "0", + "tup_returned": "15693413", + "tup_updated": "13", + "xact_commit": "31773", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "12642069", + "idx_tup_fetch": "1146350", + "idx_tup_read": "781610948", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "7449085", + "idx_tup_fetch": "562721", + "idx_tup_read": "893826457", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "25524676", + "idx_tup_fetch": "25499210", + "idx_tup_read": "25499210", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "4522561", + "idx_tup_fetch": "6209635", + "idx_tup_read": "247370671", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "181169599", + "idx_tup_fetch": "80803051", + "idx_tup_read": "704013133", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "1598403", + "idx_tup_fetch": "5430306", + "idx_tup_read": "6612718", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "4975027", + "idx_tup_fetch": "152662767", + "idx_tup_read": "167175549", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "48832773", + "idx_blks_read": "3999", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "21548099", + "idx_blks_read": "363", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "51164627", + "idx_blks_read": "7342", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "34530433", + "idx_blks_read": "394518", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "10040375", + "idx_blks_read": "1085502", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "564005506", + "idx_blks_read": "3177054", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "10525099", + "idx_blks_read": "1086753", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "178190228", + "idx_blks_read": "950774", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/7__summary.json b/integrationTests/data/7__summary.json new file mode 100644 index 0000000..669c83d --- /dev/null +++ b/integrationTests/data/7__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569912094747, + "end_time": 1569912402932, + "observation_time": 308, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/8__knobs.json b/integrationTests/data/8__knobs.json new file mode 100644 index 0000000..587ccdf --- /dev/null +++ b/integrationTests/data/8__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "542", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.706115", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "27min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "621", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "10GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "7", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "11GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "4.63611", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "4GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "738MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "794MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/8__metrics_after.json b/integrationTests/data/8__metrics_after.json new file mode 100644 index 0000000..8b9829f --- /dev/null +++ b/integrationTests/data/8__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3735691842", + "buffers_backend": "1757388651", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1855616651", + "buffers_clean": "92638493", + "checkpoint_sync_time": "13901700", + "checkpoint_write_time": "216142962", + "checkpoints_req": "10022", + "checkpoints_timed": "2925", + "maxwritten_clean": "294118", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "21977977", + "idx_tup_fetch": "33535373", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1713455", + "n_live_tup": "5999969", + "n_mod_since_analyze": "6814962", + "n_tup_del": "0", + "n_tup_hot_upd": "5582964", + "n_tup_ins": "6000000", + "n_tup_upd": "6814962", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "10809081", + "idx_tup_fetch": "10809081", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48190", + "n_live_tup": "200", + "n_mod_since_analyze": "3291425", + "n_tup_del": "0", + "n_tup_hot_upd": "3490620", + "n_tup_ins": "200", + "n_tup_upd": "3537442", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "6555041", + "idx_tup_fetch": "8241272", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "2348475", + "n_live_tup": "2080140", + "n_mod_since_analyze": "4141116", + "n_tup_del": "3277520", + "n_tup_hot_upd": "0", + "n_tup_ins": "5394229", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "7211514", + "idx_tup_fetch": "194416881", + "n_dead_tup": "20297084", + "n_live_tup": "96643501", + "n_mod_since_analyze": "129409788", + "n_tup_del": "0", + "n_tup_hot_upd": "15639341", + "n_tup_ins": "96643501", + "n_tup_upd": "32766287", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "9537442", + "n_mod_since_analyze": "3537442", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "9537442", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "37051013", + "idx_tup_fetch": "37013914", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "235882497", + "idx_tup_fetch": "235882497", + "n_dead_tup": "9190481", + "n_live_tup": "20000000", + "n_mod_since_analyze": "56648058", + "n_tup_del": "0", + "n_tup_hot_upd": "30014111", + "n_tup_ins": "20000000", + "n_tup_upd": "36648058", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "47233630", + "idx_tup_fetch": "65233627", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1297195", + "n_live_tup": "9665047", + "n_mod_since_analyze": "6942567", + "n_tup_del": "0", + "n_tup_hot_upd": "2067054", + "n_tup_ins": "9702146", + "n_tup_upd": "3277520", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "18344708", + "idx_tup_fetch": "18344708", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602369", + "n_live_tup": "1517", + "n_mod_since_analyze": "6706307", + "n_tup_del": "0", + "n_tup_hot_upd": "6638197", + "n_tup_ins": "2000", + "n_tup_upd": "7239588", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "260283347", + "heap_blks_read": "5735959", + "idx_blks_hit": "244884942", + "idx_blks_read": "1205960", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "111414673", + "heap_blks_read": "506683", + "idx_blks_hit": "183303731", + "idx_blks_read": "3077258", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "36891121", + "heap_blks_read": "160002", + "idx_blks_hit": "74272545", + "idx_blks_read": "7894", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "10997757", + "heap_blks_read": "165712", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "1295835869", + "heap_blks_read": "41655", + "idx_blks_hit": "31629340", + "idx_blks_read": "471", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "1185996223", + "heap_blks_read": "26821812", + "idx_blks_hit": "729499072", + "idx_blks_read": "3305743", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "38310125", + "heap_blks_read": "474091", + "idx_blks_hit": "52124376", + "idx_blks_read": "434325", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "49221872", + "heap_blks_read": "9986215", + "idx_blks_hit": "75578005", + "idx_blks_read": "2685485", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "885046919", + "heap_blks_read": "123871", + "idx_blks_hit": "71413246", + "idx_blks_read": "5009", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4045116", + "blks_read": "255530", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1800082", + "tup_inserted": "0", + "tup_returned": "25057634", + "tup_updated": "14", + "xact_commit": "66650", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "5337511892", + "blks_read": "54743333", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "3277623", + "tup_fetched": "604085833", + "tup_inserted": "147380505", + "tup_returned": "3910892251", + "tup_updated": "90283984", + "xact_commit": "8188609", + "xact_rollback": "37123" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2803162", + "blks_read": "110504", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "957562", + "tup_inserted": "0", + "tup_returned": "21968287", + "tup_updated": "0", + "xact_commit": "52354", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1782650", + "blks_read": "67734", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "574034", + "tup_inserted": "0", + "tup_returned": "15698799", + "tup_updated": "13", + "xact_commit": "31783", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "18344708", + "idx_tup_fetch": "1151350", + "idx_tup_read": "787313587", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "10809081", + "idx_tup_fetch": "562721", + "idx_tup_read": "1283935864", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "37051013", + "idx_tup_fetch": "37013914", + "idx_tup_read": "37013914", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "6555041", + "idx_tup_fetch": "8241272", + "idx_tup_read": "250456918", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "328384", + "idx_tup_fetch": "6328383", + "idx_tup_read": "6370091", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "2318784", + "idx_tup_fetch": "7876181", + "idx_tup_read": "9153940", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "7211514", + "idx_tup_fetch": "194416881", + "idx_tup_read": "212014253", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "235882497", + "idx_tup_fetch": "80803051", + "idx_tup_read": "1001037377", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "71413246", + "idx_blks_read": "5009", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "31629340", + "idx_blks_read": "471", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "74272545", + "idx_blks_read": "7894", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "52124376", + "idx_blks_read": "434325", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "14391144", + "idx_blks_read": "1473209", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "13388284", + "idx_blks_read": "1342301", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "244884942", + "idx_blks_read": "1205960", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "729499072", + "idx_blks_read": "3305743", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/8__metrics_before.json b/integrationTests/data/8__metrics_before.json new file mode 100644 index 0000000..6bdbc1d --- /dev/null +++ b/integrationTests/data/8__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3731260418", + "buffers_backend": "1755258665", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1854658367", + "buffers_clean": "92070166", + "checkpoint_sync_time": "13889272", + "checkpoint_write_time": "216007885", + "checkpoints_req": "10018", + "checkpoints_timed": "2925", + "maxwritten_clean": "293092", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "18755546", + "idx_tup_fetch": "29497879", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1688815", + "n_live_tup": "5999969", + "n_mod_since_analyze": "5817506", + "n_tup_del": "0", + "n_tup_hot_upd": "4602553", + "n_tup_ins": "6000000", + "n_tup_upd": "5817506", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "9223033", + "idx_tup_fetch": "9223033", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48276", + "n_live_tup": "200", + "n_mod_since_analyze": "2772169", + "n_tup_del": "0", + "n_tup_hot_upd": "2971364", + "n_tup_ins": "200", + "n_tup_upd": "3018186", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "5598641", + "idx_tup_fetch": "7285271", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "1864742", + "n_live_tup": "2020940", + "n_mod_since_analyze": "3125516", + "n_tup_del": "2799320", + "n_tup_hot_upd": "0", + "n_tup_ins": "4851296", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "6158880", + "idx_tup_fetch": "174761547", + "n_dead_tup": "18397532", + "n_live_tup": "91267523", + "n_mod_since_analyze": "119253678", + "n_tup_del": "0", + "n_tup_hot_upd": "12246846", + "n_tup_ins": "91267523", + "n_tup_upd": "27986155", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "9018186", + "n_mod_since_analyze": "3018186", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "9018186", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "31615435", + "idx_tup_fetch": "31583869", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "210092170", + "idx_tup_fetch": "210092170", + "n_dead_tup": "9101146", + "n_live_tup": "20000000", + "n_mod_since_analyze": "51272080", + "n_tup_del": "0", + "n_tup_hot_upd": "24654245", + "n_tup_ins": "20000000", + "n_tup_upd": "31272080", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "40310135", + "idx_tup_fetch": "58310132", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1255940", + "n_live_tup": "9127647", + "n_mod_since_analyze": "5926967", + "n_tup_del": "0", + "n_tup_hot_upd": "1623735", + "n_tup_ins": "9159213", + "n_tup_upd": "2799320", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "15653024", + "idx_tup_fetch": "15653024", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602434", + "n_live_tup": "1517", + "n_mod_since_analyze": "5649651", + "n_tup_del": "0", + "n_tup_hot_upd": "5576008", + "n_tup_ins": "2000", + "n_tup_upd": "6177399", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "226715528", + "heap_blks_read": "5438966", + "idx_blks_hit": "213493860", + "idx_blks_read": "1074326", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "96434300", + "heap_blks_read": "452170", + "idx_blks_hit": "157896981", + "idx_blks_read": "2462191", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "31457805", + "heap_blks_read": "158670", + "idx_blks_hit": "63375363", + "idx_blks_read": "7618", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "9403065", + "heap_blks_read": "159682", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "1110665510", + "heap_blks_read": "39431", + "idx_blks_hit": "26870183", + "idx_blks_read": "417", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "1026172176", + "heap_blks_read": "25165811", + "idx_blks_hit": "651507827", + "idx_blks_read": "3232267", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "35227227", + "heap_blks_read": "466424", + "idx_blks_hit": "43628146", + "idx_blks_read": "423341", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "43348672", + "heap_blks_read": "8667459", + "idx_blks_hit": "65624009", + "idx_blks_read": "2430479", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "879168732", + "heap_blks_read": "123807", + "idx_blks_hit": "60754817", + "idx_blks_read": "4504", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4044253", + "blks_read": "255442", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1799636", + "tup_inserted": "0", + "tup_returned": "25055182", + "tup_updated": "14", + "xact_commit": "66646", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4742469454", + "blks_read": "50312482", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "2799423", + "tup_fetched": "536952149", + "tup_inserted": "140399405", + "tup_returned": "3545133359", + "tup_updated": "77070773", + "xact_commit": "6987737", + "xact_rollback": "31590" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2803019", + "blks_read": "110440", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "957529", + "tup_inserted": "0", + "tup_returned": "21965353", + "tup_updated": "0", + "xact_commit": "52348", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1782572", + "blks_read": "67674", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "574012", + "tup_inserted": "0", + "tup_returned": "15696843", + "tup_updated": "13", + "xact_commit": "31779", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "15653024", + "idx_tup_fetch": "1148850", + "idx_tup_read": "784621903", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "9223033", + "idx_tup_fetch": "562721", + "idx_tup_read": "1099806305", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "31615435", + "idx_tup_fetch": "31583869", + "idx_tup_read": "31583869", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "5598641", + "idx_tup_fetch": "7285271", + "idx_tup_read": "249003622", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "280200", + "idx_tup_fetch": "6280199", + "idx_tup_read": "6318043", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_scan": "1978150", + "idx_tup_fetch": "6720484", + "idx_tup_read": "7959194", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "6158880", + "idx_tup_fetch": "174761547", + "idx_tup_read": "190916985", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_scan": "210092170", + "idx_tup_fetch": "80803051", + "idx_tup_read": "861170444", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "60754817", + "idx_blks_read": "4504", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "26870183", + "idx_blks_read": "417", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "63375363", + "idx_blks_read": "7618", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "43628146", + "idx_blks_read": "423341", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "12803119", + "idx_blks_read": "1168858", + "indexrelid": "48781", + "indexrelname": "idx_order", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "12112080", + "idx_blks_read": "1151702", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "213493860", + "idx_blks_read": "1074326", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "651507827", + "idx_blks_read": "3232267", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/8__summary.json b/integrationTests/data/8__summary.json new file mode 100644 index 0000000..81c29ba --- /dev/null +++ b/integrationTests/data/8__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569912454748, + "end_time": 1569912762783, + "observation_time": 308, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +} diff --git a/integrationTests/data/9__knobs.json b/integrationTests/data/9__knobs.json new file mode 100644 index 0000000..b14b4da --- /dev/null +++ b/integrationTests/data/9__knobs.json @@ -0,0 +1,267 @@ +{ + "global": {"global": { + "DateStyle": "ISO, MDY", + "IntervalStyle": "postgres", + "TimeZone": "America/New_York", + "allow_system_table_mods": "off", + "application_name": "", + "archive_command": "(disabled)", + "archive_mode": "off", + "archive_timeout": "0", + "array_nulls": "on", + "authentication_timeout": "1min", + "autovacuum": "on", + "autovacuum_analyze_scale_factor": "0.1", + "autovacuum_analyze_threshold": "50", + "autovacuum_freeze_max_age": "200000000", + "autovacuum_max_workers": "3", + "autovacuum_multixact_freeze_max_age": "400000000", + "autovacuum_naptime": "1min", + "autovacuum_vacuum_cost_delay": "20ms", + "autovacuum_vacuum_cost_limit": "-1", + "autovacuum_vacuum_scale_factor": "0.2", + "autovacuum_vacuum_threshold": "50", + "autovacuum_work_mem": "-1", + "backend_flush_after": "0", + "backslash_quote": "safe_encoding", + "bgwriter_delay": "200ms", + "bgwriter_flush_after": "512kB", + "bgwriter_lru_maxpages": "158", + "bgwriter_lru_multiplier": "2", + "block_size": "8192", + "bonjour": "off", + "bonjour_name": "", + "bytea_output": "hex", + "check_function_bodies": "on", + "checkpoint_completion_target": "0.480861", + "checkpoint_flush_after": "256kB", + "checkpoint_timeout": "6min", + "checkpoint_warning": "30s", + "client_encoding": "UTF8", + "client_min_messages": "notice", + "cluster_name": "", + "commit_delay": "0", + "commit_siblings": "5", + "config_file": "/etc/postgresql/9.6/main/postgresql.conf", + "constraint_exclusion": "partition", + "cpu_index_tuple_cost": "0.005", + "cpu_operator_cost": "0.0025", + "cpu_tuple_cost": "0.01", + "cursor_tuple_fraction": "0.1", + "data_checksums": "off", + "data_directory": "/ssd1/postgres/main", + "data_sync_retry": "off", + "db_user_namespace": "off", + "deadlock_timeout": "1s", + "debug_assertions": "off", + "debug_pretty_print": "on", + "debug_print_parse": "off", + "debug_print_plan": "off", + "debug_print_rewritten": "off", + "default_statistics_target": "914", + "default_tablespace": "", + "default_text_search_config": "pg_catalog.english", + "default_transaction_deferrable": "off", + "default_transaction_isolation": "read committed", + "default_transaction_read_only": "off", + "default_with_oids": "off", + "dynamic_library_path": "$libdir", + "dynamic_shared_memory_type": "posix", + "effective_cache_size": "15GB", + "effective_io_concurrency": "1", + "enable_bitmapscan": "on", + "enable_hashagg": "on", + "enable_hashjoin": "on", + "enable_indexonlyscan": "on", + "enable_indexscan": "on", + "enable_material": "on", + "enable_mergejoin": "on", + "enable_nestloop": "on", + "enable_seqscan": "on", + "enable_sort": "on", + "enable_tidscan": "on", + "escape_string_warning": "on", + "event_source": "PostgreSQL", + "exit_on_error": "off", + "external_pid_file": "/var/run/postgresql/9.6-main.pid", + "extra_float_digits": "3", + "force_parallel_mode": "off", + "from_collapse_limit": "8", + "fsync": "on", + "full_page_writes": "on", + "geqo": "on", + "geqo_effort": "5", + "geqo_generations": "0", + "geqo_pool_size": "0", + "geqo_seed": "0", + "geqo_selection_bias": "2", + "geqo_threshold": "12", + "gin_fuzzy_search_limit": "0", + "gin_pending_list_limit": "4MB", + "hba_file": "/etc/postgresql/9.6/main/pg_hba.conf", + "hot_standby": "off", + "hot_standby_feedback": "off", + "huge_pages": "try", + "ident_file": "/etc/postgresql/9.6/main/pg_ident.conf", + "idle_in_transaction_session_timeout": "0", + "ignore_checksum_failure": "off", + "ignore_system_indexes": "off", + "integer_datetimes": "on", + "join_collapse_limit": "8", + "krb_caseins_users": "off", + "krb_server_keyfile": "FILE:/etc/postgresql-common/krb5.keytab", + "lc_collate": "en_US.UTF-8", + "lc_ctype": "en_US.UTF-8", + "lc_messages": "en_US.UTF-8", + "lc_monetary": "en_US.UTF-8", + "lc_numeric": "en_US.UTF-8", + "lc_time": "en_US.UTF-8", + "listen_addresses": "localhost", + "lo_compat_privileges": "off", + "local_preload_libraries": "", + "lock_timeout": "0", + "log_autovacuum_min_duration": "-1", + "log_checkpoints": "off", + "log_connections": "off", + "log_destination": "stderr", + "log_directory": "pg_log", + "log_disconnections": "off", + "log_duration": "off", + "log_error_verbosity": "default", + "log_executor_stats": "off", + "log_file_mode": "0600", + "log_filename": "postgresql-%Y-%m-%d_%H%M%S.log", + "log_hostname": "off", + "log_line_prefix": "%t [%p-%l] %q%u@%d ", + "log_lock_waits": "off", + "log_min_duration_statement": "-1", + "log_min_error_statement": "error", + "log_min_messages": "warning", + "log_parser_stats": "off", + "log_planner_stats": "off", + "log_replication_commands": "off", + "log_rotation_age": "1d", + "log_rotation_size": "10MB", + "log_statement": "none", + "log_statement_stats": "off", + "log_temp_files": "-1", + "log_timezone": "America/New_York", + "log_truncate_on_rotation": "off", + "logging_collector": "off", + "maintenance_work_mem": "64MB", + "max_connections": "300", + "max_files_per_process": "1000", + "max_function_args": "100", + "max_identifier_length": "63", + "max_index_keys": "32", + "max_locks_per_transaction": "64", + "max_parallel_workers_per_gather": "2", + "max_pred_locks_per_transaction": "64", + "max_prepared_transactions": "0", + "max_replication_slots": "0", + "max_stack_depth": "2MB", + "max_standby_archive_delay": "30s", + "max_standby_streaming_delay": "30s", + "max_wal_senders": "0", + "max_wal_size": "1GB", + "max_worker_processes": "8", + "min_parallel_relation_size": "8MB", + "min_wal_size": "80MB", + "old_snapshot_threshold": "-1", + "operator_precedence_warning": "off", + "parallel_setup_cost": "1000", + "parallel_tuple_cost": "0.1", + "password_encryption": "on", + "port": "5432", + "post_auth_delay": "0", + "pre_auth_delay": "0", + "quote_all_identifiers": "off", + "random_page_cost": "9.36599", + "replacement_sort_tuples": "150000", + "restart_after_crash": "on", + "row_security": "on", + "search_path": "\"$user\", public", + "segment_size": "1GB", + "seq_page_cost": "1", + "server_encoding": "UTF8", + "server_version": "9.6.15", + "server_version_num": "90615", + "session_preload_libraries": "", + "session_replication_role": "origin", + "shared_buffers": "2GB", + "shared_preload_libraries": "", + "sql_inheritance": "on", + "ssl": "on", + "ssl_ca_file": "", + "ssl_cert_file": "/etc/ssl/certs/ssl-cert-snakeoil.pem", + "ssl_ciphers": "HIGH:MEDIUM:+3DES:!aNULL", + "ssl_crl_file": "", + "ssl_ecdh_curve": "prime256v1", + "ssl_key_file": "/etc/ssl/private/ssl-cert-snakeoil.key", + "ssl_prefer_server_ciphers": "on", + "standard_conforming_strings": "on", + "statement_timeout": "0", + "stats_temp_directory": "/var/run/postgresql/9.6-main.pg_stat_tmp", + "superuser_reserved_connections": "3", + "synchronize_seqscans": "on", + "synchronous_commit": "on", + "synchronous_standby_names": "", + "syslog_facility": "local0", + "syslog_ident": "postgres", + "syslog_sequence_numbers": "on", + "syslog_split_messages": "on", + "tcp_keepalives_count": "9", + "tcp_keepalives_idle": "7200", + "tcp_keepalives_interval": "75", + "temp_buffers": "906MB", + "temp_file_limit": "-1", + "temp_tablespaces": "", + "timezone_abbreviations": "Default", + "trace_notify": "off", + "trace_recovery_messages": "log", + "trace_sort": "off", + "track_activities": "on", + "track_activity_query_size": "1024", + "track_commit_timestamp": "off", + "track_counts": "on", + "track_functions": "none", + "track_io_timing": "off", + "transaction_deferrable": "off", + "transaction_isolation": "read committed", + "transaction_read_only": "off", + "transform_null_equals": "off", + "unix_socket_directories": "/var/run/postgresql", + "unix_socket_group": "", + "unix_socket_permissions": "0777", + "update_process_title": "on", + "vacuum_cost_delay": "0", + "vacuum_cost_limit": "200", + "vacuum_cost_page_dirty": "20", + "vacuum_cost_page_hit": "1", + "vacuum_cost_page_miss": "10", + "vacuum_defer_cleanup_age": "0", + "vacuum_freeze_min_age": "50000000", + "vacuum_freeze_table_age": "150000000", + "vacuum_multixact_freeze_min_age": "5000000", + "vacuum_multixact_freeze_table_age": "150000000", + "wal_block_size": "8192", + "wal_buffers": "16MB", + "wal_compression": "off", + "wal_keep_segments": "0", + "wal_level": "minimal", + "wal_log_hints": "off", + "wal_receiver_status_interval": "10s", + "wal_receiver_timeout": "1min", + "wal_retrieve_retry_interval": "5s", + "wal_segment_size": "16MB", + "wal_sender_timeout": "1min", + "wal_sync_method": "fdatasync", + "wal_writer_delay": "200ms", + "wal_writer_flush_after": "1MB", + "work_mem": "156MB", + "xmlbinary": "base64", + "xmloption": "content", + "zero_damaged_pages": "off" + }}, + "local": null +} diff --git a/integrationTests/data/9__metrics_after.json b/integrationTests/data/9__metrics_after.json new file mode 100644 index 0000000..48dc7ff --- /dev/null +++ b/integrationTests/data/9__metrics_after.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3739667062", + "buffers_backend": "1757877105", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1859037473", + "buffers_clean": "92846503", + "checkpoint_sync_time": "13930003", + "checkpoint_write_time": "216446066", + "checkpoints_req": "10070", + "checkpoints_timed": "2925", + "maxwritten_clean": "295323", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "23489021", + "idx_tup_fetch": "35426426", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1725318", + "n_live_tup": "5999969", + "n_mod_since_analyze": "7284343", + "n_tup_del": "0", + "n_tup_hot_upd": "6045104", + "n_tup_ins": "6000000", + "n_tup_upd": "7284343", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "11552043", + "idx_tup_fetch": "11552043", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48610", + "n_live_tup": "200", + "n_mod_since_analyze": "3534626", + "n_tup_del": "0", + "n_tup_hot_upd": "3733821", + "n_tup_ins": "200", + "n_tup_upd": "3780643", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "7007401", + "idx_tup_fetch": "8693443", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "2577186", + "n_live_tup": "2105778", + "n_mod_since_analyze": "4619114", + "n_tup_del": "3503700", + "n_tup_hot_upd": "0", + "n_tup_ins": "5648578", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "7708980", + "idx_tup_fetch": "203688192", + "n_dead_tup": "21201294", + "n_live_tup": "99160686", + "n_mod_since_analyze": "134189898", + "n_tup_del": "0", + "n_tup_hot_upd": "17241143", + "n_tup_ins": "99160686", + "n_tup_upd": "35029212", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "9780643", + "n_mod_since_analyze": "3780643", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "9780643", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "39595814", + "idx_tup_fetch": "39556184", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "247977098", + "idx_tup_fetch": "247977098", + "n_dead_tup": "9224106", + "n_live_tup": "20000000", + "n_mod_since_analyze": "59165243", + "n_tup_del": "0", + "n_tup_hot_upd": "32524442", + "n_tup_ins": "20000000", + "n_tup_upd": "39165243", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "50480031", + "idx_tup_fetch": "68480028", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1316633", + "n_live_tup": "9916865", + "n_mod_since_analyze": "7420565", + "n_tup_del": "0", + "n_tup_hot_upd": "2276617", + "n_tup_ins": "9956495", + "n_tup_upd": "3503700", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "19605608", + "idx_tup_fetch": "19605608", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602267", + "n_live_tup": "1517", + "n_mod_since_analyze": "7201326", + "n_tup_del": "0", + "n_tup_hot_upd": "7135747", + "n_tup_ins": "2000", + "n_tup_upd": "7737138", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "276061843", + "heap_blks_read": "6017468", + "idx_blks_hit": "259626756", + "idx_blks_read": "1288989", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "118430206", + "heap_blks_read": "542779", + "idx_blks_hit": "195017863", + "idx_blks_read": "3563629", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "39433080", + "heap_blks_read": "162524", + "idx_blks_hit": "79374009", + "idx_blks_read": "8170", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "11748810", + "heap_blks_read": "168516", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "1382592299", + "heap_blks_read": "43879", + "idx_blks_hit": "33859290", + "idx_blks_read": "525", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "1259872846", + "heap_blks_read": "28750777", + "idx_blks_hit": "765997545", + "idx_blks_read": "3414257", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "39761232", + "heap_blks_read": "491145", + "idx_blks_hit": "55688837", + "idx_blks_read": "463644", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "51667740", + "heap_blks_read": "10907467", + "idx_blks_hit": "80094150", + "idx_blks_read": "2948779", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "887800405", + "heap_blks_read": "123935", + "idx_blks_hit": "76405780", + "idx_blks_read": "5514", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4045979", + "blks_read": "255618", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1800528", + "tup_inserted": "0", + "tup_returned": "25060086", + "tup_updated": "14", + "xact_commit": "66654", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "5614326717", + "blks_read": "58907720", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "4", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "3503803", + "tup_fetched": "635651873", + "tup_inserted": "150649589", + "tup_returned": "4082374270", + "tup_updated": "96500406", + "xact_commit": "8751532", + "xact_rollback": "39657" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2804248", + "blks_read": "110622", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "958101", + "tup_inserted": "0", + "tup_returned": "21971802", + "tup_updated": "0", + "xact_commit": "52366", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1783552", + "blks_read": "67852", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "574491", + "tup_inserted": "0", + "tup_returned": "15702229", + "tup_updated": "13", + "xact_commit": "31789", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "19605608", + "idx_tup_fetch": "1153850", + "idx_tup_read": "788574487", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "11552043", + "idx_tup_fetch": "562721", + "idx_tup_read": "1370205965", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "39595814", + "idx_tup_fetch": "39556184", + "idx_tup_read": "39556184", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "7007401", + "idx_tup_fetch": "8693443", + "idx_tup_read": "251146357", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "247977098", + "idx_tup_fetch": "80803051", + "idx_tup_read": "1066566264", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "2478116", + "idx_tup_fetch": "8415522", + "idx_tup_read": "9708469", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "7708980", + "idx_tup_fetch": "203688192", + "idx_tup_read": "221969864", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "76405780", + "idx_blks_read": "5514", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "33859290", + "idx_blks_read": "525", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "79374009", + "idx_blks_read": "8170", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "55688837", + "idx_blks_read": "463644", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "13991593", + "idx_blks_read": "1649177", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "765997545", + "idx_blks_read": "3414257", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "13926353", + "idx_blks_read": "1486331", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "259626756", + "idx_blks_read": "1288989", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/9__metrics_before.json b/integrationTests/data/9__metrics_before.json new file mode 100644 index 0000000..1e446ef --- /dev/null +++ b/integrationTests/data/9__metrics_before.json @@ -0,0 +1,585 @@ +{ + "global": { + "pg_stat_archiver": { + "archived_count": "0", + "failed_count": "0", + "stats_reset": "2019-09-11 21:28:47.239843-04" + }, + "pg_stat_bgwriter": { + "buffers_alloc": "3735692175", + "buffers_backend": "1757390104", + "buffers_backend_fsync": "0", + "buffers_checkpoint": "1855779340", + "buffers_clean": "92653402", + "checkpoint_sync_time": "13901735", + "checkpoint_write_time": "216182706", + "checkpoints_req": "10022", + "checkpoints_timed": "2925", + "maxwritten_clean": "294118", + "stats_reset": "2019-09-11 21:28:47.239843-04" + } + }, + "local": { + "table": { + "pg_stat_user_tables": { + "customer": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "21977977", + "idx_tup_fetch": "33535373", + "last_autoanalyze": "2019-10-01 01:58:54.728893-04", + "n_dead_tup": "1713455", + "n_live_tup": "5999969", + "n_mod_since_analyze": "6814962", + "n_tup_del": "0", + "n_tup_hot_upd": "5582964", + "n_tup_ins": "6000000", + "n_tup_upd": "6814962", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "24000000", + "vacuum_count": "0" + }, + "warehouse": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "10809081", + "idx_tup_fetch": "10809081", + "last_autoanalyze": "2019-10-01 02:06:15.381455-04", + "last_autovacuum": "2019-10-01 02:06:14.304752-04", + "n_dead_tup": "48190", + "n_live_tup": "200", + "n_mod_since_analyze": "3291425", + "n_tup_del": "0", + "n_tup_hot_upd": "3490620", + "n_tup_ins": "200", + "n_tup_upd": "3537442", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public", + "seq_scan": "77", + "seq_tup_read": "15400", + "vacuum_count": "0" + }, + "new_order": { + "analyze_count": "0", + "autoanalyze_count": "5", + "autovacuum_count": "3", + "idx_scan": "6555041", + "idx_tup_fetch": "8241272", + "last_autoanalyze": "2019-10-01 02:27:19.017545-04", + "last_autovacuum": "2019-10-01 02:23:41.594799-04", + "n_dead_tup": "2348475", + "n_live_tup": "2080140", + "n_mod_since_analyze": "4141116", + "n_tup_del": "3277520", + "n_tup_hot_upd": "0", + "n_tup_ins": "5394229", + "n_tup_upd": "0", + "relid": "48721", + "relname": "new_order", + "schemaname": "public", + "seq_scan": "1", + "seq_tup_read": "1692083", + "vacuum_count": "0" + }, + "order_line": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "7211514", + "idx_tup_fetch": "194416881", + "n_dead_tup": "20297084", + "n_live_tup": "96643501", + "n_mod_since_analyze": "129409788", + "n_tup_del": "0", + "n_tup_hot_upd": "15639341", + "n_tup_ins": "96643501", + "n_tup_upd": "32766287", + "relid": "48728", + "relname": "order_line", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "119990886", + "vacuum_count": "0" + }, + "history": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "last_autoanalyze": "2019-10-01 01:53:35.074571-04", + "n_dead_tup": "0", + "n_live_tup": "9537442", + "n_mod_since_analyze": "3537442", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "9537442", + "n_tup_upd": "0", + "relid": "48714", + "relname": "history", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "12000000", + "vacuum_count": "0" + }, + "item": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "37051013", + "idx_tup_fetch": "37013914", + "last_autoanalyze": "2019-10-01 02:04:54.904867-04", + "n_dead_tup": "0", + "n_live_tup": "100000", + "n_mod_since_analyze": "0", + "n_tup_del": "0", + "n_tup_hot_upd": "0", + "n_tup_ins": "100000", + "n_tup_upd": "0", + "relid": "48718", + "relname": "item", + "schemaname": "public", + "seq_scan": "2", + "seq_tup_read": "200000", + "vacuum_count": "0" + }, + "stock": { + "analyze_count": "0", + "autoanalyze_count": "0", + "autovacuum_count": "0", + "idx_scan": "235882497", + "idx_tup_fetch": "235882497", + "n_dead_tup": "9190481", + "n_live_tup": "20000000", + "n_mod_since_analyze": "56648058", + "n_tup_del": "0", + "n_tup_hot_upd": "30014111", + "n_tup_ins": "20000000", + "n_tup_upd": "36648058", + "relid": "48731", + "relname": "stock", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "60000000", + "vacuum_count": "0" + }, + "oorder": { + "analyze_count": "0", + "autoanalyze_count": "1", + "autovacuum_count": "0", + "idx_scan": "47233630", + "idx_tup_fetch": "65233627", + "last_autoanalyze": "2019-10-01 01:53:45.816842-04", + "n_dead_tup": "1297195", + "n_live_tup": "9665047", + "n_mod_since_analyze": "6942567", + "n_tup_del": "0", + "n_tup_hot_upd": "2067054", + "n_tup_ins": "9702146", + "n_tup_upd": "3277520", + "relid": "48724", + "relname": "oorder", + "schemaname": "public", + "seq_scan": "3", + "seq_tup_read": "18000000", + "vacuum_count": "0" + }, + "district": { + "analyze_count": "0", + "autoanalyze_count": "4", + "autovacuum_count": "3", + "idx_scan": "18344708", + "idx_tup_fetch": "18344708", + "last_autoanalyze": "2019-10-01 02:06:10.033539-04", + "last_autovacuum": "2019-10-01 02:06:07.202845-04", + "n_dead_tup": "602369", + "n_live_tup": "1517", + "n_mod_since_analyze": "6706307", + "n_tup_del": "0", + "n_tup_hot_upd": "6638197", + "n_tup_ins": "2000", + "n_tup_upd": "7239588", + "relid": "48711", + "relname": "district", + "schemaname": "public", + "seq_scan": "4", + "seq_tup_read": "8000", + "vacuum_count": "0" + } + }, + "pg_statio_user_tables": { + "order_line": { + "heap_blks_hit": "260337673", + "heap_blks_read": "5796482", + "idx_blks_hit": "244884942", + "idx_blks_read": "1205960", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + }, + "oorder": { + "heap_blks_hit": "111414673", + "heap_blks_read": "506683", + "idx_blks_hit": "183303731", + "idx_blks_read": "3077258", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "item": { + "heap_blks_hit": "36891121", + "heap_blks_read": "160002", + "idx_blks_hit": "74272545", + "idx_blks_read": "7894", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "history": { + "heap_blks_hit": "10997757", + "heap_blks_read": "165712", + "relid": "48714", + "relname": "history", + "schemaname": "public" + }, + "warehouse": { + "heap_blks_hit": "1295835869", + "heap_blks_read": "41655", + "idx_blks_hit": "31629340", + "idx_blks_read": "471", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "stock": { + "heap_blks_hit": "1186057271", + "heap_blks_read": "26919432", + "idx_blks_hit": "729499072", + "idx_blks_read": "3305743", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "new_order": { + "heap_blks_hit": "38311850", + "heap_blks_read": "483114", + "idx_blks_hit": "52174758", + "idx_blks_read": "457021", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "customer": { + "heap_blks_hit": "49221872", + "heap_blks_read": "9986215", + "idx_blks_hit": "75578005", + "idx_blks_read": "2685485", + "relid": "48704", + "relname": "customer", + "schemaname": "public", + "tidx_blks_hit": "0", + "tidx_blks_read": "0", + "toast_blks_hit": "0", + "toast_blks_read": "0" + }, + "district": { + "heap_blks_hit": "885046919", + "heap_blks_read": "123871", + "idx_blks_hit": "71413246", + "idx_blks_read": "5009", + "relid": "48711", + "relname": "district", + "schemaname": "public" + } + } + }, + "database": { + "pg_stat_database": { + "postgres": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "4045116", + "blks_read": "255530", + "conflicts": "0", + "datid": "12439", + "datname": "postgres", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 21:28:47.953315-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "1800082", + "tup_inserted": "0", + "tup_returned": "25057634", + "tup_updated": "14", + "xact_commit": "66650", + "xact_rollback": "11" + }, + "tpcc": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "5337681226", + "blks_read": "54933461", + "conflicts": "0", + "datid": "48703", + "datname": "tpcc", + "deadlocks": "0", + "numbackends": "1", + "stats_reset": "2019-10-01 01:52:19.906323-04", + "temp_bytes": "2081841152", + "temp_files": "3", + "tup_deleted": "3277623", + "tup_fetched": "604086966", + "tup_inserted": "147380505", + "tup_returned": "3910897924", + "tup_updated": "90283984", + "xact_commit": "8188627", + "xact_rollback": "37126" + }, + "template1": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "2804105", + "blks_read": "110558", + "conflicts": "0", + "datid": "1", + "datname": "template1", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-11 22:05:20.533143-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "958068", + "tup_inserted": "0", + "tup_returned": "21968868", + "tup_updated": "0", + "xact_commit": "52360", + "xact_rollback": "0" + }, + "template0": { + "blk_read_time": "0", + "blk_write_time": "0", + "blks_hit": "1783474", + "blks_read": "67792", + "conflicts": "0", + "datid": "12438", + "datname": "template0", + "deadlocks": "0", + "numbackends": "0", + "stats_reset": "2019-09-17 02:25:02.20631-04", + "temp_bytes": "0", + "temp_files": "0", + "tup_deleted": "0", + "tup_fetched": "574469", + "tup_inserted": "0", + "tup_returned": "15700273", + "tup_updated": "13", + "xact_commit": "31785", + "xact_rollback": "0" + } + }, + "pg_stat_database_conflicts": { + "postgres": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12439", + "datname": "postgres" + }, + "tpcc": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "48703", + "datname": "tpcc" + }, + "template1": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "1", + "datname": "template1" + }, + "template0": { + "confl_bufferpin": "0", + "confl_deadlock": "0", + "confl_lock": "0", + "confl_snapshot": "0", + "confl_tablespace": "0", + "datid": "12438", + "datname": "template0" + } + } + }, + "indexes": { + "pg_stat_user_indexes": { + "district": { + "idx_scan": "18344708", + "idx_tup_fetch": "1151350", + "idx_tup_read": "787313587", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_scan": "10809081", + "idx_tup_fetch": "562721", + "idx_tup_read": "1283935864", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_scan": "37051013", + "idx_tup_fetch": "37013914", + "idx_tup_read": "37013914", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_scan": "6555041", + "idx_tup_fetch": "8241272", + "idx_tup_read": "250456918", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_scan": "0", + "idx_tup_fetch": "0", + "idx_tup_read": "0", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_scan": "235882497", + "idx_tup_fetch": "80803051", + "idx_tup_read": "1001037377", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_scan": "2318784", + "idx_tup_fetch": "7876181", + "idx_tup_read": "9153940", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_scan": "7211514", + "idx_tup_fetch": "194416881", + "idx_tup_read": "212014253", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + }, + "pg_statio_user_indexes": { + "district": { + "idx_blks_hit": "71413246", + "idx_blks_read": "5009", + "indexrelid": "48748", + "indexrelname": "district_pkey", + "relid": "48711", + "relname": "district", + "schemaname": "public" + }, + "warehouse": { + "idx_blks_hit": "31629340", + "idx_blks_read": "471", + "indexrelid": "48750", + "indexrelname": "warehouse_pkey", + "relid": "48734", + "relname": "warehouse", + "schemaname": "public" + }, + "item": { + "idx_blks_hit": "74272545", + "idx_blks_read": "7894", + "indexrelid": "48757", + "indexrelname": "item_pkey", + "relid": "48718", + "relname": "item", + "schemaname": "public" + }, + "new_order": { + "idx_blks_hit": "52174758", + "idx_blks_read": "457021", + "indexrelid": "48759", + "indexrelname": "new_order_pkey", + "relid": "48721", + "relname": "new_order", + "schemaname": "public" + }, + "oorder": { + "idx_blks_hit": "13406402", + "idx_blks_read": "1417173", + "indexrelid": "48777", + "indexrelname": "oorder_o_w_id_o_d_id_o_c_id_o_id_key", + "relid": "48724", + "relname": "oorder", + "schemaname": "public" + }, + "stock": { + "idx_blks_hit": "729499072", + "idx_blks_read": "3305743", + "indexrelid": "48815", + "indexrelname": "stock_pkey", + "relid": "48731", + "relname": "stock", + "schemaname": "public" + }, + "customer": { + "idx_blks_hit": "13388284", + "idx_blks_read": "1342301", + "indexrelid": "48797", + "indexrelname": "idx_customer_name", + "relid": "48704", + "relname": "customer", + "schemaname": "public" + }, + "order_line": { + "idx_blks_hit": "244884942", + "idx_blks_read": "1205960", + "indexrelid": "48813", + "indexrelname": "order_line_pkey", + "relid": "48728", + "relname": "order_line", + "schemaname": "public" + } + } + } + } +} diff --git a/integrationTests/data/9__summary.json b/integrationTests/data/9__summary.json new file mode 100644 index 0000000..116ea9a --- /dev/null +++ b/integrationTests/data/9__summary.json @@ -0,0 +1,8 @@ +{ + "start_time": 1569912808025, + "end_time": 1569913111333, + "observation_time": 303, + "database_type": "postgres", + "database_version": "9.6", + "workload_name": "tpcc" +}