| 1 | -module(beam_stats_config). |
| 2 | |
| 3 | -export( |
| 4 | [ production_interval/0 |
| 5 | , consumers/0 |
| 6 | ]). |
| 7 | |
| 8 | -define(APP, beam_stats). |
| 9 | |
| 10 | %% ============================================================================ |
| 11 | %% API |
| 12 | %% ============================================================================ |
| 13 | |
| 14 | -spec production_interval() -> |
| 15 | non_neg_integer(). |
| 16 | production_interval() -> |
| 17 | get_env(production_interval). |
| 18 | |
| 19 | -spec consumers() -> |
| 20 | [{ConsumerModule :: module(), ConsumerDefinedOptionsData :: term()}]. |
| 21 | consumers() -> |
| 22 | get_env(consumers). |
| 23 | |
| 24 | %% ============================================================================ |
| 25 | %% Internal |
| 26 | %% ============================================================================ |
| 27 | |
| 28 | -spec get_env(atom()) -> |
| 29 | term(). |
| 30 | get_env(Key) -> |
| 31 | {ok, Value} = application:get_env(?APP, Key), |
| 32 | Value. |