# Module monitor_perf

- Description
- Data Types
- Function Index
- Function Details

Periodically executes a small benchmark to monitor the overall performance of Scalaris.

Copyright © 2011-2015 Zuse Institute Berlin

Version: $Id$

Behaviours: `gen_component`.

Authors: Nico Kruber (`kruber@zib.de`).

## Description

Periodically executes a small benchmark to monitor the overall performance of Scalaris.

## Data Types

### erlang_timestamp()

    erlang_timestamp() =
        {MegaSecs :: non_neg_integer(),
         Secs :: 0..999999,
         MicroSecs :: 0..999999}

### message()

    message() =
        {bench} |
        {bench_result,
         Time :: erlang_timestamp(),
         TimeInMs :: non_neg_integer()} |
        {bench_timeout, Time :: erlang_timestamp(), BenchPid :: pid()} |
        {collect_system_stats} |
        {propagate} |
        {get_node_details_response, node_details:node_details()} |
        {bulkowner,
         deliver,
         Id :: uid:global_uid(),
         Range :: intervals:interval(),
         {gather_stats,
          SourcePid :: comm:mypid(),
          Id :: uid:global_uid()},
         Parents :: [comm:mypid(), ...]} |
        {bulkowner,
         gather,
         Id :: uid:global_uid(),
         Target :: comm:mypid(),
         Msgs :: [comm:message(), ...],
         Parents :: [comm:mypid()]} |
        {bulkowner,
         reply,
         Id :: uid:global_uid(),
         {gather_stats_response,
          Id :: uid:global_uid(),
          [{Process :: atom(),
            Key :: monitor:key(),
            Data :: rrd:timing_type()}]}} |
        {bulkowner,
         deliver,
         Id :: uid:global_uid(),
         Range :: intervals:interval(),
         {report_value,
          StatsOneRound ::
              #state{id = uid:global_uid(),
                     perf_rr = rrd:rrd(),
                     perf_lh = rrd:rrd(),
                     perf_tx = rrd:rrd()}},
         Parents :: [comm:mypid(), ...]}

### state()

    state() =
        {AllNodes ::
             #state{id = uid:global_uid(),
                    perf_rr = rrd:rrd(),
                    perf_lh = rrd:rrd(),
                    perf_tx = rrd:rrd()},
         CollectingAtLeader ::
             #state{id = uid:global_uid(),
                    perf_rr = rrd:rrd(),
                    perf_lh = rrd:rrd(),
                    perf_tx = rrd:rrd()},
         BenchPid :: pid() | ok,
         IgnoreBenchTimeout :: boolean()}

## Function Index

check_config/0 | Checks whether config parameters of the rm_tman process exist and are valid.
init/1 | Initialises the module with an empty state.
on/2 | Message handler when the rm_loop module is fully initialized.
start_gen_component/5 |
start_link/1 | Starts the monitor process, registers it with the process dictionary and returns its pid for use by a supervisor.

## Function Details

### start_gen_component/5

    start_gen_component(Module :: module(),
                        Handler :: gen_component:handler(),
                        Args :: term(),
                        Options :: [gen_component:option()],
                        Self :: pid()) ->
                           no_return() | ok

### on/2

    on(Msg :: message(), State :: state()) -> state()

Message handler when the rm_loop module is fully initialized.

### start_link/1

    start_link(DHTNodeGroup :: pid_groups:groupname()) -> {ok, pid()}

Starts the monitor process, registers it with the process dictionary and returns its pid for use by a supervisor.

### init/1

    init(X1 :: null) -> state()

Initialises the module with an empty state.

### check_config/0

    check_config() -> boolean()

Checks whether config parameters of the rm_tman process exist and are valid.

Generated by EDoc, Apr 22 2017, 15:58:26.