Qbik Helpsys

Counter

The global data Counter item allows you to create a counter that can be incremented or decremented by WinGate components and services as required.

The counter is useful in lots of situations that require activity measurement, such as creating counters to tally the amount of times a service is used, the amount of times a policy item is hit during policy evaluation, or monitoring the frequency of certain web requests.

Creating counters

Counters can be created in several ways:

  1. Using the Global Data panel

    1. Open the WinGate Management console.
    2. Navigate to Control Panel > Data.
    3. In the Tasks menu select New counter. Or alternatively right click anywhere on the Global Data panel and select New counter from the menu. This will open the Edit Counter configuration.
    4. In the Counter name field, enter a suitable name for the counter. This is the name that will be used to refer to this counter when accessing global data from throughout WinGate.
    5. In the Initial/reset value field, enter a value that the counter will default to if it is reset.
    6. In the Value field, set the starting value that the counter will begin incrementing or decrementing (This is set at zero by default).
    7. Select the Store counter value between restarts checkbox if you wish the counter to be kept after the WinGate engine has been stopped and restarted, otherwise it will be deleted the next time the WinGate engine is stopped.
    8. Select Publish counter for monitoring option if you wish to have the Data system monitor changes the counter. This will make the counter available to be monitored the Monitoring tab.
    9. Click OK and the new counter will now be listed in the Global Data panel.
  2. Using script

    When using a WinGate scripting system (such as the Lua or Javascript event processors) or a configuration that has access to a Symbol browser, you can use the Data object published by the Data module to manage counters. The Data object provides the GetCounter(Text CounterName) method that you can use to create and manipulate global data counters.

    e.g. A script could contain:

    Data.GetCounter("testcounter")

    This would attempt to get the value of a global data counter called testcounter. If this counter did not exist, a new counter would be created automatically with the name testcounter. Like other global data items, if the specified global data counter does not exist then it is created automatically.

    Read more about using WinGate objects

Note

Naming global data items

After they are created, global data items are identified throughout WinGate by their type (e.g. a string, a boolean, a list etc), and the name you give them.

Global data items of the same type must each have a unique name. If you create a new global data item with the same name as an existing item of the same type, then the new item will replace the old one.

Using counters

Like other global data items, counters can be referenced, modified, and deleted whenever you are:

  1. Using a WinGate script system.
  2. Using a WinGate configuration that has access to the Symbol browser.

Read about accessing global data items

  1. no comments yet...

Download helpfile

You can use basic Full-Text Searches against the page title and body to find matching articles. Use the following search modifiers to refine your query:

  • event management (no quotes) will find all pages containing the words "event" OR "management"
  • "event management" (with quotes) will find all pages containing the phrase "event management"
  • +event -management will find all pages containing the word "event", AND NOT the word "management"