Ferricstore.RaFileInstrument (ferricstore v0.3.3)

Copy Markdown View Source

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

install()

@spec install() :: :ok

Install the instrumented ra_file module (call before ra starts)

record_sync(elapsed_us)

@spec record_sync(non_neg_integer()) :: true

Record a sync call duration (called from the patched ra_file)

report()

@spec report() :: :ok

Print collected fsync stats

reset()

@spec reset() :: :ok

Reset counters