Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to process usage using printing as a service stream with metering, you must create meter type (the product you want to meter) and meters (bucket to measure the usage per customer for the product). This step is usually done using an APIs which are called from the external system. For convenience, there has have been additional streams provided which can be executed to do this configuration.

Here is a step-by-step guide on how you can provision meters and meter types for an the example stream - printing as a service Printing As A Service with Metering.

The helper streams can be copied from the links and can be imported using the Usage Engine CE UIuser interface:

  1. Provisioning Meter Types - This stream helps to creates a create the meter type (Pay-per-print) , which is a product definition for measuring prints done by each printer. It uses the aggregation type SUM and has the reset interval set as Monthly ie, to Monthly meaning that the golden record is sent downstream once the month has ended.

  2. Provisioning Meters - This stream provision provisions the meters for printers with the printer id as a the key (user Id).

  3. Purge Meters - This is an additional stream to clean-up meters post processing.

Step 1

Create a new application access for your account. This is needed for authenticating with the Usage Engine APIs. See , see Application Access.

Step 2

Create a new secret in the secrets wallet of type OAuth 2.0 containing your applications application credentials. Select authentication type “Client credentials“ and add client ID and client secret which is being was created in the previous step. See , see Secret Wallets.

Step 3

Import all helper streams using the above links.

Step 4

Update the authentication in all streams with your new secret. Ensure that the audience and access token URL of the OAuth2 authentication is configured to match your Environments API base URL.

Step 5

Run stream 1. Provisioning Meter Types. After the stream has completed you will have a new meter type named "Pay-per-print" in the Usage metering section view.

Step 6

Navigate to "the Usage metering" Metering View and copy the ids id of the meter type with category "Printing" for later.

Also, open Open the stream configuration of for Printing As A Service with Metering and copy the meter key from the Meter processor for later.

Step 7

Open the stream configuration of 2. Provisioning Meters and open the script named "Prepare Meters". Paste in the meter type ids and meter key that you got from the previous step.

Step 8

Run stream 2. Provisioning Meters. After When the stream has completed, you will have 5 meters across your newly created meter type.

Step 9

The meters you created in the previous step is are now associated with the Meter Processor processor in the Printing As A Service with Metering stream.

Run Printing As A Service with Metering the stream. After its completionWhen it has completed, you will be able to see the aggregated values from the input records in the inspection tab Meter Inspector.

Step 10 (Optional)

If you want to delete your meters. Navigate to the stream configuration of 3. Purge Meters. Paste the meter type ids and meter key into the script "Prepare Filter". Run the stream. Now all meters related to Printing As A Service with Metering have been deleted.