OSSL and LSL QoS functions – osGetRegionStats(), OsConsoleCommand(), llGetRegionFPS()

Some of OSSL and LSL functions are tailored to gather Performance Quality of Service (QoS) metrics on simulator level or region level in OpenSim and Second Life.

These provide some caveats: mainly they stress the system that they are measuring performance and second there is no better control over the process of gathering QoS.

In order for the OSSL functions mentioned in this article to work, they should be enabled with adequate threat level which should be set to “very high” or “severe”. More information can be found here.

osGetRegionStats() is an OSSL function that returns a list of number of region statistics. The following code is taken verbatim from the OpenSim WIKI, each QoS metric can be saved in a variable or printed or even stored in a file (maybe appended notecard that can be read later).

list Stats = osGetRegionStats();

string s = “Sim FPS: ” + (string) llList2Float( Stats, STATS_SIM_FPS ) + “\n”;

s += “Physics FPS: ” + (string) llList2Float( Stats, STATS_PHYSICS_FPS ) + “\n”;

s += “Time Dilation: ” + (string) llList2Float( Stats, STATS_TIME_DILATION ) + “\n”;

s += “Root Agents: ” + (string) llList2Integer( Stats, STATS_ROOT_AGENTS ) + “\n”;

s += “Child Agents: ” + (string) llList2Integer( Stats, STATS_CHILD_AGENTS ) + “\n”;

s += “Total Prims: ” + (string) llList2Integer( Stats, STATS_TOTAL_PRIMS ) + “\n”;

s += “Active Scripts: ” + (string) llList2Integer( Stats, STATS_ACTIVE_SCRIPTS ) + “\n”;

s += “Script LPS: ” + (string) llList2Float( Stats, STATS_SCRIPT_LPS );

llSetText( s, <0.0,1.0,0.0>, 1.0 );

llGetRegionFPS() is an LSL function that returns “a float that is the mean region frames per second”.

llGetRegionTimeDilation() is an LSL function  that “Returns a float that is the current time dilation, the value range is [0.0, 1.0], 0.0 (full dilation) and 1.0 (no dilation)”

osConsoleCommand is an interesting OSSL function that allow LSL scripts to execute an OpenSim Server console command. In particular a command like save stats stat.txt or any other interesting ones for gathering QoS. The script owner should have the necessary permission to call this function

Example taken from the Wiki:

default

{

touch_start(integer num_detected)

{

osConsoleCommand(“login disable”);

llSay(0, “Logins are disabled”);

}

}

The interesting thing about these commands is that they could be included in a script that loops for the time of the mobility model of an avatar. The avatar could attach a prim with a script inside it or it could be placed on site.

Leave a Reply

Your email address will not be published. Required fields are marked *