This page describes what you need to consider when designing and executing your Usage metering streams.
Recommendations on Stream Execution
...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
At this point, you should have designed the metering solution by creating,
meter types
meters
stream with meter processor (including guiding rules that have been tested using preview).
The next step is to execute the stream with a meter processor. The processing of the usage data and updates on meters relies on the stream execution. If a stream containing a Meter 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 flushed, it is recommended to schedule the stream with a frequency higher than the meters are reset according to the meter types' Reset schedule. For .
It is recommended that you run a stream more frequently than the meter type’s Reset schedule. This will ensure that the meters are metering for the correct period and are being flushed as defined in the Reset schedule. As an 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 Flushing Metered Records
The Inspect view can be used to get an overview of the different meters associated with the Meter processor function and make sure that meters are being updated correctly after a stream execution, see Meter Inspector.
A stream can be executed regularly by using the stream Schedule. If the stream configuration is updated then the stream must be rescheduled for any changes to take 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 are found, they . Meters with an expired Period end will be flushed to the next processor in the stream and reset, starting . this will start a new metering period before processing additional incoming data.
If a stream is configured to flush by Period end, in the meter processor a reset scan to check the 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 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?
...