# `Instruments.Sysmon.Reporter`

Since only one process can subscribe to system monitor events, the Reporter
acts as a relay for system monitor events, allowing multiple subscribers to
receive system monitor events.

On startup, the Reporter will subscribe to the system monitor events
configured in `:sysmon_events` in the `:instruments` application environment.
If no events are configured, the Reporter will not subscribe to any events.

# `sysmon_event`

```elixir
@type sysmon_event() ::
  {:long_gc, pos_integer()}
  | {:long_schedule, pos_integer()}
  | {:large_heap, pos_integer()}
  | :busy_port
  | :busy_dist_port
```

# `t`

```elixir
@type t() :: %Instruments.Sysmon.Reporter{
  events: [sysmon_event()],
  subscribers: %{required(reference()) =&gt; pid()}
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_events`

```elixir
@spec get_events() :: [sysmon_event()]
```

Returns the system monitor events the Reporter is subscribed to.

# `set_events`

```elixir
@spec set_events([sysmon_event()]) :: :ok
```

Sets the system monitor events to subscribe to. If no events are provided, the Reporter will not register itself as the system monitor process.

# `start_link`

# `subscribe`

```elixir
@spec subscribe(pid()) :: :ok
```

Subscribes the provided pid to configured system monitor events.

# `unsubscribe`

```elixir
@spec unsubscribe(pid()) :: :ok
```

Unsubscribes the provided pid from system monitor events.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
