Remove unused stats

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Tools
    • None
    • Storage Engines, Storage Engines - Foundations
    • None
    • None

      Each stat, even if it's never used, takes space in FTDC. We currently have 183 some unused stats.

      1. Understand which stats are actually unused and clean them up.
      2. Consider adding a check to s_all.

      One-liner to collect unused stats gives quite a lot of false positives since some stats are used via macros (like histograms) but it could be a starting point for investigation.

      perl -MIO::File -nE 'BEGIN { for (IO::File->new("dist/stat_data.py", "r")->getlines()) { /Stat\(\x27([^\x27]*)/ and $h{$1}=1 } $re = "."; } if (/[ (]($re)[,)]/) { delete $h{$1}; $re = join "|", keys %h; } END {say join "\n", sort keys %h}' $(find src -name \*.[ch] -not -name stat.[ch] -not -name conf_keys.[ch])
      

      Output:

      cache_hs_btree_truncate_dryrun
      cache_hs_insert_restart
      cache_hs_key_truncate_rts_dryrun
      cache_hs_key_truncate_rts_unstable_dryrun
      compress_read_ratio_hist_16
      compress_read_ratio_hist_2
      compress_read_ratio_hist_32
      compress_read_ratio_hist_4
      compress_read_ratio_hist_64
      compress_read_ratio_hist_8
      compress_read_ratio_hist_max
      compress_write_ratio_hist_16
      compress_write_ratio_hist_2
      compress_write_ratio_hist_32
      compress_write_ratio_hist_4
      compress_write_ratio_hist_64
      compress_write_ratio_hist_8
      compress_write_ratio_hist_max
      cursor_bound_error
      cursor_cache_error
      cursor_close_error
      cursor_compare_error
      cursor_equals_error
      cursor_get_key_error
      cursor_get_value_error
      cursor_insert_check_error
      cursor_insert_error
      cursor_largest_key_error
      cursor_modify_error
      cursor_next_error
      cursor_next_random_error
      cursor_prev_error
      cursor_reconfigure_error
      cursor_remove_error
      cursor_reopen_error
      cursor_reserve_error
      cursor_reset_error
      cursor_search_error
      cursor_search_near_error
      cursor_search_near_prefix_fast_paths
      cursor_tree_walk_ondisk_del_page_skip
      cursor_update_error
      layered_table_manager_checkpoints
      layered_table_manager_logops_applied
      layered_table_manager_logops_skipped
      layered_table_manager_skip_lsn
      live_restore_hist_source_read_latency_gt1000
      live_restore_hist_source_read_latency_lt10
      live_restore_hist_source_read_latency_lt100
      live_restore_hist_source_read_latency_lt1000
      live_restore_hist_source_read_latency_lt2
      live_restore_hist_source_read_latency_lt250
      live_restore_hist_source_read_latency_lt5
      live_restore_hist_source_read_latency_lt50
      live_restore_hist_source_read_latency_lt500
      live_restore_hist_source_read_latency_total_msecs
      lock_btree_page_count
      lock_btree_page_wait_application
      lock_btree_page_wait_internal
      lock_checkpoint_count
      lock_checkpoint_wait_application
      lock_checkpoint_wait_internal
      lock_dhandle_read_count
      lock_dhandle_wait
      lock_dhandle_wait_application
      lock_dhandle_wait_internal
      lock_dhandle_write_count
      lock_metadata_count
      lock_metadata_wait_application
      lock_metadata_wait_internal
      lock_schema_count
      lock_schema_wait
      lock_schema_wait_application
      lock_schema_wait_internal
      lock_table_read_count
      lock_table_wait_application
      lock_table_wait_internal
      lock_table_write_count
      lock_txn_global_read_count
      lock_txn_global_wait_application
      lock_txn_global_wait_internal
      lock_txn_global_write_count
      perf_hist_bmread_latency_gt1000
      perf_hist_bmread_latency_lt10
      perf_hist_bmread_latency_lt100
      perf_hist_bmread_latency_lt1000
      perf_hist_bmread_latency_lt2
      perf_hist_bmread_latency_lt250
      perf_hist_bmread_latency_lt5
      perf_hist_bmread_latency_lt50
      perf_hist_bmread_latency_lt500
      perf_hist_bmread_latency_total_msecs
      perf_hist_bmwrite_latency_gt1000
      perf_hist_bmwrite_latency_lt10
      perf_hist_bmwrite_latency_lt100
      perf_hist_bmwrite_latency_lt1000
      perf_hist_bmwrite_latency_lt2
      perf_hist_bmwrite_latency_lt250
      perf_hist_bmwrite_latency_lt5
      perf_hist_bmwrite_latency_lt50
      perf_hist_bmwrite_latency_lt500
      perf_hist_bmwrite_latency_total_msecs
      perf_hist_disaggbmread_latency_gt10000
      perf_hist_disaggbmread_latency_lt100
      perf_hist_disaggbmread_latency_lt1000
      perf_hist_disaggbmread_latency_lt10000
      perf_hist_disaggbmread_latency_lt250
      perf_hist_disaggbmread_latency_lt2500
      perf_hist_disaggbmread_latency_lt500
      perf_hist_disaggbmread_latency_lt5000
      perf_hist_disaggbmread_latency_total_usecs
      perf_hist_disaggbmwrite_latency_gt10000
      perf_hist_disaggbmwrite_latency_lt100
      perf_hist_disaggbmwrite_latency_lt1000
      perf_hist_disaggbmwrite_latency_lt10000
      perf_hist_disaggbmwrite_latency_lt250
      perf_hist_disaggbmwrite_latency_lt2500
      perf_hist_disaggbmwrite_latency_lt500
      perf_hist_disaggbmwrite_latency_lt5000
      perf_hist_disaggbmwrite_latency_total_usecs
      perf_hist_fsread_latency_gt1000
      perf_hist_fsread_latency_lt10
      perf_hist_fsread_latency_lt100
      perf_hist_fsread_latency_lt1000
      perf_hist_fsread_latency_lt2
      perf_hist_fsread_latency_lt250
      perf_hist_fsread_latency_lt5
      perf_hist_fsread_latency_lt50
      perf_hist_fsread_latency_lt500
      perf_hist_fsread_latency_total_msecs
      perf_hist_fswrite_latency_gt1000
      perf_hist_fswrite_latency_lt10
      perf_hist_fswrite_latency_lt100
      perf_hist_fswrite_latency_lt1000
      perf_hist_fswrite_latency_lt2
      perf_hist_fswrite_latency_lt250
      perf_hist_fswrite_latency_lt5
      perf_hist_fswrite_latency_lt50
      perf_hist_fswrite_latency_lt500
      perf_hist_fswrite_latency_total_msecs
      perf_hist_internal_reconstruct_latency_gt10000
      perf_hist_internal_reconstruct_latency_lt100
      perf_hist_internal_reconstruct_latency_lt1000
      perf_hist_internal_reconstruct_latency_lt10000
      perf_hist_internal_reconstruct_latency_lt250
      perf_hist_internal_reconstruct_latency_lt2500
      perf_hist_internal_reconstruct_latency_lt500
      perf_hist_internal_reconstruct_latency_lt5000
      perf_hist_internal_reconstruct_latency_total_usecs
      perf_hist_leaf_reconstruct_latency_gt10000
      perf_hist_leaf_reconstruct_latency_lt100
      perf_hist_leaf_reconstruct_latency_lt1000
      perf_hist_leaf_reconstruct_latency_lt10000
      perf_hist_leaf_reconstruct_latency_lt250
      perf_hist_leaf_reconstruct_latency_lt2500
      perf_hist_leaf_reconstruct_latency_lt500
      perf_hist_leaf_reconstruct_latency_lt5000
      perf_hist_leaf_reconstruct_latency_total_usecs
      perf_hist_opread_latency_gt10000
      perf_hist_opread_latency_lt100
      perf_hist_opread_latency_lt1000
      perf_hist_opread_latency_lt10000
      perf_hist_opread_latency_lt250
      perf_hist_opread_latency_lt2500
      perf_hist_opread_latency_lt500
      perf_hist_opread_latency_lt5000
      perf_hist_opread_latency_total_usecs
      perf_hist_opwrite_latency_gt10000
      perf_hist_opwrite_latency_lt100
      perf_hist_opwrite_latency_lt1000
      perf_hist_opwrite_latency_lt10000
      perf_hist_opwrite_latency_lt250
      perf_hist_opwrite_latency_lt2500
      perf_hist_opwrite_latency_lt500
      perf_hist_opwrite_latency_lt5000
      perf_hist_opwrite_latency_total_usecs
      txn_rts_hs_removed_dryrun
      txn_rts_hs_restore_tombstones_dryrun
      txn_rts_hs_restore_updates_dryrun
      txn_rts_keys_removed_dryrun
      txn_rts_keys_restored_dryrun
      txn_rts_sweep_hs_keys_dryrun
      txn_rts_upd_aborted_dryrun
      

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Yury Ershov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: