Skip to content

Commit

Permalink
Tweak the alarms documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Sep 7, 2021
1 parent 0277ef9 commit 57f4bae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions doc/src/guide/listeners.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ processes.
=== Setting connection count alarms

The `alarms` transport option allows you to configure alarms
which will be triggered when the number of connections under a connection
supervisor reaches or exceeds the defined treshold.
which will be triggered when the number of connections tracked
by one connection supervisor reaches or exceeds the defined treshold.

The `alarms` transport option takes a map with alarm names as keys and alarm
options as values.
Expand All @@ -343,7 +343,7 @@ Alarm options include the alarm type and a treshold that, when reached,
triggers the given callback. A cooldown prevents the alarm from being
triggered too often.

.Setting an alarm to log warnings when the number of connections exceed 100
.Log warnings when the number of connections exceeds 100

[source,erlang]
----
Expand All @@ -366,8 +366,8 @@ Alarms = #{
----

In the example code, an alarm named `my_alarm` is defined, which will
call the given function when the number of connections under a
connection supervisor reaches or exceeds 100. When the number of
call the given function when the number of connections tracked
by the connection supervisor reaches or exceeds 100. When the number of
connections is still (or again) above 100 after the default cooldown
period of 5 seconds, the alarm will trigger again.

Expand Down
8 changes: 4 additions & 4 deletions doc/src/manual/ranch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ None of the options are required.

alarms (#{})::

Alarms to call a function when the number of connections under a
connection supervisor reaches or exceeds a defined treshold.
Alarms to call a function when the number of connections tracked
by one connection supervisor reaches or exceeds a defined treshold.
+
The map keys are the alarm names, which can be any `term`. The
associated values are the respective alarm options, again in a map
Expand All @@ -131,8 +131,8 @@ Must be set to `num_connections`.
treshold:::

Treshold value, which must be a `non_neg_integer`. When the
number of connections under a connection supervisor reaches
or exceeds this value, The alarm will trigger and call
number of connections tracked by a single connection supervisor
reaches or exceeds this value, The alarm will trigger and call
the function defined in the `callback` key (see below).

callback:::
Expand Down

0 comments on commit 57f4bae

Please sign in to comment.