Module Expr Str ImportFrom alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias ImportFrom alias ImportFrom alias alias alias alias alias alias alias alias alias alias alias FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Return ListLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Return ListLoad Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Return ListLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad orelse Return ListLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad Assign NameStore ListLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore ListStore NameStore NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore ListStore NameStore NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore ListLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameStore NameLoad body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return ListLoad Call NameLoad Call NameLoad NameLoad decorator_list
N/A N/A 
This module provides all the metrics in correct format for output.

Steps for adding statistic values as metrics:
1) Write function for extracting the statistics value:
    * extract from DB, then write it in postgres_queries.py
    * extract from local Postgres data directory,
      then write it in localhost_postgres_stats.py
2) Write a function into default_metrics.py for transferring a statistic into a metric.
3) Write a function in this module to call both of the above defined functions,
   returning the metrics in correct form (always in a list, see below).
4) Add the name of the function in this module into the configuration,
   and define the interval the metric should be called.
 postgresql_metrics.default_metrics metric_client_connections metric_database_size metric_transaction_rate metric_rollbacks_rate metric_seconds_since_last_vacuum metric_blocks_read_from_disk metric_blocks_read_from_buffer metric_blocks_heap_hit_ratio metric_locks_granted metric_locks_waiting metric_sec_since_oldest_xact_start metric_table_bloat metric_index_hit_ratio metric_replication_delay_bytes metric_wal_file_amount postgresql_metrics.localhost_postgres_stats get_amount_of_wal_files postgresql_metrics.postgres_queries get_client_connections_amount get_disk_usage_for_database get_transaction_rate_for_database get_seconds_since_last_vacuum_per_table get_heap_hit_statistics get_lock_statistics get_oldest_transaction_timestamp get_table_bloat get_index_hit_rates get_replication_delays get_tables_with_oids_for_current_db get_stats_client_connections N/A N/A db_connection N/A N/A N/A client_amount N/A get_client_connections_amount db_connection N/A N/A N/A metric_client_connections client_amount N/A get_stats_disk_usage_for_database N/A N/A db_connection N/A N/A N/A db_size N/A get_disk_usage_for_database db_connection N/A N/A N/A metric_database_size N/A db_size N/A 0 N/A db_size N/A 1 N/A get_stats_tx_rate_for_database N/A N/A db_connection N/A N/A N/A N/A db_name tx_rate tx_rollbacks N/A get_transaction_rate_for_database db_connection N/A N/A tx_rate None N/A N/A N/A N/A metric_transaction_rate db_name tx_rate N/A metric_rollbacks_rate db_name tx_rollbacks N/A N/A N/A N/A get_stats_seconds_since_last_vacuum_per_table N/A N/A db_connection N/A N/A N/A last_vacuums_data N/A get_seconds_since_last_vacuum_per_table db_connection N/A metrics N/A N/A N/A db_name table_name seconds_since last_vacuums_data N/A N/A N/A N/A metrics append N/A metric_seconds_since_last_vacuum db_name table_name seconds_since N/A metrics N/A get_stats_heap_hit_statistics N/A N/A db_connection N/A N/A N/A N/A db_name heap_read heap_hit heap_hit_ratio N/A get_heap_hit_statistics db_connection N/A metrics N/A N/A N/A heap_hit_ratio None N/A N/A N/A N/A metrics append N/A metric_blocks_read_from_disk db_name heap_read N/A N/A N/A metrics append N/A metric_blocks_read_from_buffer db_name heap_hit N/A N/A N/A metrics append N/A metric_blocks_heap_hit_ratio db_name heap_hit_ratio N/A metrics N/A get_stats_lock_statistics N/A N/A db_connection N/A N/A N/A N/A locks_by_type N/A total_locks_waiting total_locks_granted N/A get_lock_statistics db_connection N/A metrics N/A N/A N/A lock_type N/A locks_waiting locks_granted N/A N/A locks_by_type iteritems N/A N/A N/A N/A metrics append N/A metric_locks_granted lock_type locks_granted N/A N/A N/A metrics append N/A metric_locks_waiting lock_type locks_waiting N/A N/A N/A metrics append N/A metric_locks_granted total total_locks_granted N/A N/A N/A metrics append N/A metric_locks_waiting total total_locks_waiting N/A metrics N/A get_stats_oldest_transaction_timestamp N/A N/A db_connection N/A N/A N/A N/A db_name sec_since_oldest_xact_start N/A get_oldest_transaction_timestamp db_connection N/A metrics N/A N/A N/A sec_since_oldest_xact_start None N/A N/A N/A N/A metrics append N/A metric_sec_since_oldest_xact_start db_name sec_since_oldest_xact_start N/A metrics N/A get_stats_table_bloat N/A N/A db_connection N/A N/A N/A tables_with_oids N/A get_tables_with_oids_for_current_db db_connection N/A metrics N/A N/A N/A table_oid table_name tables_with_oids N/A N/A N/A db_name table_bloat_percentage N/A get_table_bloat db_connection table_oid N/A db_name N/A N/A N/A N/A metrics append N/A metric_table_bloat db_name table_name table_bloat_percentage N/A metrics N/A get_stats_index_hit_rates N/A N/A db_connection N/A N/A N/A index_hit_rates N/A get_index_hit_rates db_connection N/A metrics N/A N/A N/A db_name table_name index_hit_ratio index_hit_rates N/A N/A N/A index_hit_ratio None N/A N/A N/A N/A metrics append N/A metric_index_hit_ratio db_name table_name index_hit_ratio N/A metrics N/A get_stats_replication_delays N/A N/A db_connection N/A N/A N/A replication_delays N/A get_replication_delays db_connection N/A metrics N/A N/A N/A client_addr delay_in_bytes replication_delays N/A N/A N/A N/A metrics append N/A metric_replication_delay_bytes client_addr delay_in_bytes N/A metrics N/A get_stats_wal_file_amount N/A N/A data_dir N/A N/A N/A N/A N/A metric_wal_file_amount N/A get_amount_of_wal_files data_dir N/A