-
Notifications
You must be signed in to change notification settings - Fork 69
/
mnesia.ex
31 lines (28 loc) · 917 Bytes
/
mnesia.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
defmodule Prometheus.Contrib.Mnesia do
@moduledoc """
Mnesia instrumentation helpers.
"""
use Prometheus.Erlang, :prometheus_mnesia
@doc """
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
<a href="http://erlang.org/doc/apps/mnesia/Mnesia_chap7.html">
Mnesia System Information chapter
</a> of Mnesia User's Guide
"""
delegate table_disk_size(dir \\ :mnesia.system_info(:directory), table)
@doc """
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.
"""
delegate tm_info()
end