Counter Statements

Counter statements allow you to send a notfication about an identified counter and its value. Each time a counter statement is sent, the given value is stored along with a timestamp. In practice, this means you can count objects or how many times specific actions occur.

Prerequisites

You have entered this line of code. It is required before sending any notifications:

// sets the user name and machine name from the global context ctx.monitor.setUserVariables(ctx.options.userName, ctx.options.computerName, '');

Insert a counter statement like the following:

The parameters in brackets represent the information that will appear in the CVS file you will download in the Cloud Factory. These parameters include:

  • "name"

    • Choose the name for the notification. We strongly recommend that you pay attention to the name you give to your counter statement, in order to find it easily.

    • The maximum size should be 256 characters.

  • "category"

    • Choose a category, as a text string.

    • The maximum size should be 50 characters.

  • "value"

    • Choose a value for the counter, as a text string.

    • The maximum size should be 50 characters.

  • "data":

    • Write your text data for the notification.

    • There is no maximum size for this parameter. However, the total value of all the parameters together should not exceed 50000 characters.

Example Use Case

You can count the number of times the scenario has gone through a certain piece of code.