Module count_input
Expand description
Input counting middleware.
This module provides a small middleware and layer for tracking how many inputs a service has processed in total and how many are currently being served concurrently.
The core concepts are:
InputCounter: a counter abstraction that tracks total and concurrent inputsInputCounterTracker: a per input tracker that is inserted into input extensionsCountInput: a service wrapper that increments and decrements the counterCountInputLayer: aLayerproducingCountInputservices
The tracker allows any inner service to observe:
- The live number of concurrent inputs
- The total number of inputs seen so far
- The sequence number of the current input
Structs§
- Count
Input - Service that counts total and concurrent inputs and exposes a tracker via extensions.
- Count
Input Layer - A
Layerthat producesCountInputservices. - Default
Input Counter - Default counter implementation based on atomics.
- Input
Counter Extension - The default tracker extension inserted into input extensions by
CountInputwhen usingDefaultInputCounter.
Traits§
- Input
Counter - A counter used by
CountInputto track total and concurrent inputs. - Input
Counter Tracker - Tracks per input counters and exposes them as an extension.