vADC Forum

Reply
Contributor
Posts: 29
Registered: ‎10-19-2013
Accepted Solution

Report of script speed

Hi all,

i just noticed that one of my traffic-scripts are taking 20 ms to execute, which is way to slow. this is just because of a non-optimized function done by myself.

to avoid such bad scripting failures, i want to create a report how long each script is executing. Alternative, create a alert when a script takes longer than x ms.

I can't find a way of doing that. Any hints ?

-Jochen

Contributor
Posts: 58
Registered: ‎11-29-2012

Re: Report of script speed

Sorry this was overlooked..

One option is to use timing and calculations along with logging in Traffic Script


$start = sys.time.highres();



$stop = string.sprintf( "%f", sys.time.highres() - $start );



log.info ( $stop );




Stay tuned for additional options....

Contributor
Posts: 58
Registered: ‎11-29-2012

Re: Report of script speed

Also take a look into a new feature as of version 9.6 Selective Logging of Connections.

From the 9.6 Release Notes

A new hook into TrafficScript rules has been added that runs on completion of a transaction (i.e. when the server has finished sending its response, or when the connection has been closed). Rules can be configured to run at this time on the Virtual Server > Rules page.

The new TrafficScript hook allows rules to determine information such as the total transaction duration, which could then be used to facilitate selectively logging slow transactions using functions such as requestlog.include() or recentconns.include().

Contributor
Posts: 29
Registered: ‎10-19-2013

Re: Report of script speed

the new hooks are great!

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.