Skip to content

Commit 3c26290

Browse files
committed
Remove ra_server:metrics/1
1 parent 115ec38 commit 3c26290

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/ra_server.erl

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
tick/1,
3131
log_tick/1,
3232
overview/1,
33-
metrics/1,
3433
is_new/1,
3534
is_fully_persisted/1,
3635
is_fully_replicated/1,
@@ -1795,28 +1794,6 @@ cfg_to_map(Cfg) ->
17951794
{N + 1, Acc#{F => element(N, Cfg)}}
17961795
end, {2, #{}}, record_info(fields, cfg))).
17971796

1798-
-spec metrics(ra_server_state()) ->
1799-
{atom(), ra_term(),
1800-
ra_index(), ra_index(),
1801-
ra_index(), ra_index(), non_neg_integer()}.
1802-
metrics(#{cfg := #cfg{metrics_key = Key},
1803-
commit_index := CI,
1804-
last_applied := LA,
1805-
current_term := CT,
1806-
log := Log} = State) ->
1807-
SnapIdx = case ra_log:snapshot_index_term(Log) of
1808-
undefined -> 0;
1809-
{I, _} -> I
1810-
end,
1811-
CL = case State of
1812-
#{commit_latency := L} ->
1813-
L;
1814-
_ ->
1815-
0
1816-
end,
1817-
{LW, _} = ra_log:last_index_term(Log),
1818-
{Key, CT, SnapIdx, LA, CI, LW, CL}.
1819-
18201797
-spec is_new(ra_server_state()) -> boolean().
18211798
is_new(#{log := Log}) ->
18221799
ra_log:next_index(Log) =:= 1.

0 commit comments

Comments
 (0)