cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
436
Views
0
Helpful
1
Replies

CRS Script Menu Access Counter

rbpollock01
Level 1
Level 1

I have been trying to find a way or find a table in the CRS SQL database that we could use to track how often a Menu is access in one of our scripts. Does anyone know if this exists in the SQL database or a way to script out some kind of increment to a document on the server? Thanks

1 Reply 1

sferland
Level 1
Level 1

The concept of "counter" has never been implemented by Cisco in the CRS.

Since most of my customers need this type of tracking, I built a custom library which provide me all the tools I need for that.

Here are the methods of this library:

- public boolean incCounter(String pCounterName, int pValue)

- public boolean decCounter(String pCounterName, int pValue)

- public boolean setCounter(String pCounterName, int pValue)

- public String getCounter(String pCounterName)

- public boolean writeCounters(String pSessionID)

During the call, all the counters value are kept in an HashMap variable. Then, when the call ends, the method "writeCounters" will insert all of them into the database in a special table.

Here is the specification of the table:

- Session_ID : varchar

- Start_Hour : date

- End_Hour : date

- CNT_XXXX : int

- CNT_YYYY : int

- CNT_ZZZZ : int

- ...

I have one column per counter in my script. So, one row, is equal to one call. Columns Start_Hour and End_Hour are populated directly in the custom class. At constructor time and then when I call "writeCounters".

I hope this help.