1%% This Source Code Form is subject to the terms of the Mozilla Public
2%% License, v. 2.0. If a copy of the MPL was not distributed with this
3%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
4%%
5%% Copyright (c) 2007-2021 VMware, Inc. or its affiliates.  All rights reserved.
6%%
7
8-module(rabbit_metrics).
9
10-behaviour(gen_server).
11
12-export([start_link/0]).
13
14-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
15         code_change/3]).
16
17-define(SERVER, ?MODULE).
18
19%%----------------------------------------------------------------------------
20%% Starts the raw metrics storage and owns the ETS tables.
21%%----------------------------------------------------------------------------
22
23-spec start_link() -> rabbit_types:ok_pid_or_error().
24
25start_link() ->
26    gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
27
28init([]) ->
29    rabbit_core_metrics:init(),
30    {ok, none}.
31
32handle_call(_Request, _From, State) ->
33    {noreply, State}.
34
35handle_cast(_Request, State) ->
36    {noreply, State}.
37
38handle_info(_Msg, State) ->
39    {noreply, State}.
40
41terminate(_Reason, _State) ->
42    ok.
43
44code_change(_OldVsn, State, _Extra) ->
45    {ok, State}.
46