This page describes what you need to consider when designing and executing your Usage metering streams.
Recommendations on Stream Execution
The processing of meters relies on stream executionsOnce you have, designed the metering solution by creating,
meter types
meters
stream with meter processor including guiding rules, and guiding rules has been tested using preview.
The next step is to execute the stream with meter processor, as the processing of the usage data and updates on meters relies on the stream execution. If a stream containing a Meter processor connected to a set of meters is not executed, the meters linked to that stream will not be updated, reset or flushed, see Creating Meter Types for more information about Reset schedule and Flushing below for more information about reset and flush.
To ensure that meters are reset and get flushedcalculating for correct period and are being flushed as defined in Reset schedule, it is recommended to schedule run the stream with a frequency higher than the meters are reset according to the meter types' Reset schedule. For example, if you have configured the meter type to reset the meters once a day, then the stream linked to your meter type should run at least once a day or more. If you only run your stream every second day, the new period of the meter will cover two days instead of one. The reason is that when the Meter processor calculates the new period end, it will pick the nearest future timestamp based on the periodicity of the meter type.
...
Flush is when the result of the aggregated data in the Meter Processor is sent to downstream systems. When this happens, the values of the meters are also reset to their initial value, for example 0, to empty the bucket and prepare for the next metering period.
Based on the settings configured in the Meter Processor, a stream might flush the meters at the beginning of its execution, at the end of the stream, or both.
When a stream starts in a batch stream scenarioSee Meter Reset in Metered Output Record
The Inspect view, can be used to get overview of the different meters associated with the Meter processor function and make sure that meters are being updated correctly after stream execution, see Meter Inspector.
Stream can be executed on regular basis by using the stream scheduling Schedule. If stream configuration is updated then then stream must be rescheduled to take changes in effect.
Realtime vs Batch Stream Execution
The stream can be executed in batch and real-time mode. For more information on real-time and batch streams, see Glossary
When a stream is executed as a batch stream, the Meter Processor will start by scanning the meter storage for meters whose period end has passed, performing a reset scan. If any expired meters whose period has ended are found, they will be flushed to next processor in stream and reset, starting a new metering period before processing incoming data. If a stream is configured to flush by Period end, in the meter processor a reset scan to check meter period end will also be performed at the end of the stream execution, but if a stream is configured to flush by Stream execution then all meters in your storage linked to that meter processor will be reset and flushed regardless of whether the meters period have expired ended or not.
When you have a stream in a real-time scenario, the reset scan to check meter period end will execute once every minute 60 seconds to check for any meters that should be flushedwhose period has ended. This means that meters can be flushed once every minute. A Meter processor running in a real-time scenario can only be configured with a flush by Period end.
Realtime vs Batch Streams
Batch streams are streams that start, process a set of data and end.
Real-time streams are streams that are started and then constantly running, receiving data and processing it as it arrives. Streams using
Data Correction for Usage Metering
No meter found for data correction
Meters will only be flushed if they have been updated since last flush when the Active to: time has passed.
...
When stream runs what happens first flush or reading of new data?
What is our recommendation on when stream should run based on schedule?
Output Data
When the data is sent to downstream systems, also known as flush, a record in json format will be sent for each meter associated with the Meter processor.
...
There is also an Inspect view, which provides you with an overview of the different meters associated with the Meter processor function, see Meter Inspector.