View Source prometheus_mnesia (prometheus v5.0.0)

Mnesia instrumentation helpers.

Summary

Functions

Returns sum of all mnesia files for the given Table in bytes. Mnesia can create different files for each table

Returns {PCount, CCount} tuple, where PCount is a number of participant transactions and CCount is a number of coordinator transactions.

Functions

table_disk_size(Table)

-spec table_disk_size(Table) -> Size when Table :: file:name_all(), Size :: non_neg_integer().

Equivalent to table_disk_size(mnesia:system_info(directory), Table).

table_disk_size(Dir, Table)

-spec table_disk_size(Dir, Table) -> Size
                         when
                             Dir :: file:name_all(), Table :: file:name_all(), Size :: non_neg_integer().

Returns sum of all mnesia files for the given Table in bytes. Mnesia can create different files for each table:

  • .DAT: DETS files
  • .TMP: temp files
  • .DMP: dumped ets tables
  • .DCD: disc copies data
  • .DCL: disc copies log
  • .LOGTMP: disc copies log

More on Mnesia files can be found in Mnesia System Information chapter of Mnesia User's Guide.

tm_info()

-spec tm_info() -> {Ps, Cs} | {undefined, undefined}
                 when Ps :: non_neg_integer(), Cs :: non_neg_integer().

Returns {PCount, CCount} tuple, where PCount is a number of participant transactions and CCount is a number of coordinator transactions.

Can return {undefined, undefined} occasionally.