From justin at seafelt.com Fri Jun 29 20:28:04 2007 From: justin at seafelt.com (Justin Warren) Date: Fri, 29 Jun 2007 20:28:04 +1000 Subject: [seafelt-devel] Relativity and Search Saving Feature Message-ID: <1183112884.7405.24.camel@localhost> Two main updates today: The rollup code that I 'fixed' a few weeks back was actually correct, and my 'fix' made all the rollups break. The problem I was trying to fix was that the elemvar 'availability' wasn't set as relative in the database. This is a hangover from the old days when availability was saved as a pre-calculated float value of measured availability in seconds / delta_time to make charting the HealthBar easier. This calculation is now done by the charting code at runtime for the Healthbar, as it is useful to know how many seconds of availability an element had. The best of both worlds. Whether or not an elemvar should be considered relative should be determined by how it is rolled up: The delta_time values are summed, so a relative value is also rolled up by summing, giving you cumulative total for the period of time the delta_time value indicates. Absolute values are averaged over the same delta time. For example, over an hour (3600 seconds), your availability total may be 3540 seconds, because the element was not available for 30 seconds during some time period measured in that hour. The other major announcement is a feature: You can now save an element search as a Group. This takes the SQL query used to find the particular element set you searched for and saves it as a Query, which is then linked to a Group. The Group and Query objects are saved in your home folder, and you can then move them into the global /groups folder if you want to have them appear in the global Groups area. Saving searches as groups is only available to logged in users. Both the fix to the rollup code and the new feature will be present in tonight's build. To activate the rollup code, change availability to relative in your database thusly: 1. Re-install the seafelt packages (python setup.py install, or via apt/dpkg) 2. Copy the new templates/elemvar.ecf into your instance directory using your method of choice: seafelt-config --retemplate --template-mode copy or seafelt-config --retemplate --template-mode symlink or manually copying them. 3. Reload the database config: seafelt-config --load or, if you are comfortable with SQL, skip step 2 & 3 and run this SQL in your seafelt database: UPDATE elemvars SET elemvar_relative = 't' WHERE elemvar_name = 'availability'; Enjoy! -- Justin Warren seafelt.com: Making sense of a sea of data.