Wednesday, 9 September 2015

RELEASE ANNOUNCEMENT: Paramour Region Traffic Monitor v2.0

This morning I added a new utility to the Parmour Shopping center's scripted item offerings: the Region Traffic Monitor 2.0.

A Bit of Background

Some of you may be using the (now very old) basic greeter script I posted in the OSGrid scripting forum a few years ago. For general purpose use that one's fine, but it wasn't intended for every high traffic regions so made little (or no) effort to minimize resource usage. As soon as someone new is greeted it stores an updated visitor log and it also gives you the ability to hand notecards and landmarks to your visitor as part of their initial greeting. All of these operation have to use thread-locking functions that put a bit of a hit load on a region that could already be struggling to handle your newly-arrived guest if there is significant traffic volume.

The basic V1 script is also limited by the 64k storage capacity of a single notecard so it will "run out of tracking space" once you've had about 700 unique visitors to your region. If you exceed that limit, Opensim will fail to store the newly updated notecard. does this without any warning -- in region or in console -- and ends up losing all of your data.

I wasn't aware of that until my Hedonism region (which uses a modified, lower-load version of that script) suddenly lost all of my previous visitor data. Luckily I had it backed up so I only lost 1 or two entries, but it did force me to get around to scripting a new mechanism for handling greeting and visitor tracking for higher traffic regions While I was at it, I further adjusted my overall mechanisms to create an even more streamlined and lower-load script than I'd already written for Hedonism. I delay storing new data until 5 minutes after the most recent person has arrived (which will get pushed back if more people enter) to give the simulator enough opportunity to handle the inbound login before asking it to store notecard data; spreading out the load.

The result is....

The New Paramour Region Traffic Monitor 2.0

This is a complete rewrite of the greeter and traffic monitor script, fine-tuned to provide maximum performance and minimum impact for high traffic regions.

Individual months' data is now stored on separate notecards so the storage capacity limit of a notecard shouldn't be an issue at all unless your region has more than about 1000 unique visitors in a single month. In the unlikely event that you need a script that can handle more than that, get in touch with me and I can probably write one for you or suggest a viable method for it.

The new version DOES NOT give landmarks or notecards because of the hit on the simulator from the threadlocking functions. If you want to provide those things I strongly suggest a separate box sitting nearby that is set to "sell contents" when someone touches it. This achieves the same thing without the very nasty -- and potentially debilitating -- hit of doing it via script.

The greeting text is fully customizable, including the ability to wildcard the visitor's name as part of the greeting. A separate text is supplied for a first-time and a repeat visitor.

A set of basic statistics is (optionally) displayed in floaty text above the greeter. The colour and alpha of the text is customizable or you can turn it off altogether. The statistics show the number of (non-NPC) users currently in the region, as well as how many unique visitors you've had in the last 24 hours, the last 7 days, the last 30 days, and all-time.

The greeter is region-wide with unlimited range, so a single greeter can handle the job even in an enormous var.

The Greeter can (optionally) notify the owner when someone enters the region. Normally it will only do so if the owner is also present (and do so privately so it doesn't spam chat), however it can be also be configured to send you an instant message to notify you if you're absent. I DO NOT recommend enabling that IM capability except at periods where you expect region traffic to be extremely low since that function is also a very nasty thread-lock it to the simulator. When enabled it will only invoke the function if you aren't in the region, though. If you're in the region it will notify you the "friendly" non-sim-hurting way.

There methods used in the new script do all the tracking via UNIX timestamp which isn't every human-friendly to read, so I've supplied an optional add-on script that you can place in the same object.

This allows the owner to touch the greeter and be given a copy of a specific month's traffic report, reformatted to show the day of the week and date of each person's most recent visit during that month, their name, and their grid. An additional section of the report supplies a summary of visitor stats for that period to tell you how many unique visitors you had, how many were local and how many were hypergrid, and how many different grids they came from. All times in the report are adjusted to use PST/PDT (or "grid time").

These reports are a bit more system-intensive so it's much better to have them as a separate run-on-depend application that you can activate at a time when your region is experiencing a very low traffic volume.

This scripts make use of OSSL functions to minimize sim impact so you'll need OSSL enabled and sufficient permissions for the script owner to be able to use it.

Where To Get It

A boxed version of this is now available in my Paramour Shopping region (HGTP to then take the local portal to Paramour Shopping) and is on the upper floor of the main building, near the many other Paramour scripted products (west side of the building's U shape).

You can just re-texture and use that box, or move the scripts out of it and into any other object in your region you like. An Read Me notecard contains general instructions for use, and further details are supplied in the scripts to help you set any custom parameters you wish.

Like all Paramour products, it's full perm and released under Creative Commons Attribution-Non-Commercial-ShareAlike 4.0 International license

You can see the script in action in both my Hedonism and Paramour Shopping regions.