Instruments ra_file:sync/1 to collect timing data about WAL fsync calls.
Call install/0 before ra starts to monkey-patch the ra_file module.
Call report/0 to print collected stats.
Call uninstall/0 to restore the original module.
Data is stored in a :counters (total_calls, total_us) and an ETS table for histogram buckets.
Summary
Functions
Install the instrumented ra_file module (call before ra starts)
Record a sync call duration (called from the patched ra_file)
Print collected fsync stats
Reset counters
Functions
@spec install() :: :ok
Install the instrumented ra_file module (call before ra starts)
@spec record_sync(non_neg_integer()) :: true
Record a sync call duration (called from the patched ra_file)
@spec report() :: :ok
Print collected fsync stats
@spec reset() :: :ok
Reset counters