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.
Counters can be created in several ways:
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.
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.
Like other global data items, counters can be referenced, modified, and deleted whenever you are:
Read about accessing global data items
©2012 Qbik New Zealand Limited
no comments yet...
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:
You can create a new account or reset your password at forum.wingate.com.