From 53a8db10195f9aae640b238fa3d571bf0136a55a Mon Sep 17 00:00:00 2001 From: Jan Uhlig Date: Wed, 2 Oct 2024 12:22:10 +0200 Subject: Fix alarm setting typo The setting `threshold` was misspelled as `treshold`. --- doc/src/guide/listeners.asciidoc | 6 +++--- doc/src/guide/migrating_from_2.0.asciidoc | 2 +- doc/src/manual/ranch.asciidoc | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/src/guide/listeners.asciidoc b/doc/src/guide/listeners.asciidoc index 9ee2d98..c30cb5c 100644 --- a/doc/src/guide/listeners.asciidoc +++ b/doc/src/guide/listeners.asciidoc @@ -332,14 +332,14 @@ processes. The `alarms` transport option allows you to configure alarms which will be triggered when the number of connections tracked -by one connection supervisor reaches or exceeds the defined treshold. +by one connection supervisor reaches or exceeds the defined threshold. The `alarms` transport option takes a map with alarm names as keys and alarm options as values. Any term is allowed as an alarm name. -Alarm options include the alarm type and a treshold that, when reached, +Alarm options include the alarm type and a threshold that, when reached, triggers the given callback. A cooldown prevents the alarm from being triggered too often. @@ -350,7 +350,7 @@ triggered too often. Alarms = #{ my_alarm => #{ type => num_connections, - treshold => 100, + threshold => 100, callback => fun(Ref, Name, ConnSup, ConnPids]) -> logger:warning("Warning (~s): " "Supervisor ~s of listener ~s " diff --git a/doc/src/guide/migrating_from_2.0.asciidoc b/doc/src/guide/migrating_from_2.0.asciidoc index fb2c69d..498a581 100644 --- a/doc/src/guide/migrating_from_2.0.asciidoc +++ b/doc/src/guide/migrating_from_2.0.asciidoc @@ -18,7 +18,7 @@ for Erlang/OTP 21 has been removed. * Alarms can now be configured. The only alarm currently available is `num_connections`. When the number of - connections goes over a configurable treshold Ranch + connections goes over a configurable threshold Ranch will call the given callback. This can be used to programmatically shut down idle connections to make up space for new connections, for example. diff --git a/doc/src/manual/ranch.asciidoc b/doc/src/manual/ranch.asciidoc index 2f62b81..b5dd615 100644 --- a/doc/src/manual/ranch.asciidoc +++ b/doc/src/manual/ranch.asciidoc @@ -91,7 +91,7 @@ transport_opts(SocketOpts) = #{ alarms => #{ term() => #{ type := num_connections, - treshold := non_neg_integer(), + threshold := non_neg_integer(), callback := fun((ref(), term(), pid(), [pid()]) -> any()), cooldown => non_neg_integer() } @@ -118,7 +118,7 @@ None of the options are required. alarms (#{}):: Alarms to call a function when the number of connections tracked -by one connection supervisor reaches or exceeds a defined treshold. +by one connection supervisor reaches or exceeds a defined threshold. + The map keys are the alarm names, which can be any `term`. The associated values are the respective alarm options, again in a map @@ -128,9 +128,9 @@ type::: Must be set to `num_connections`. -treshold::: +threshold::: -Treshold value, which must be a `non_neg_integer`. When the +Threshold value, which must be a `non_neg_integer`. When the 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). -- cgit v1.2.3