Loading...
 
Skip to main content

History: Metrics Dashboard

Source of version: 8 (current)

Copy to clipboard
            ! Metrics Dashboard

^Feature Deprecated: This feature existed between Tiki version 5 to Tiki version 12 and was removed in Tiki version 13 as it was subsequently not used and was too difficult to configure. If we were to do it now, there are more modern ways to implement similar functionality.^

Integrated in ((Tiki5)), and initially developed as part of the Support Mozilla project, the metrics dashboard allows the administrator of a site to configure metrics to be tracked over time, by means of __tiki-metrics.php__. The site editors can then use these metrics to investigate changes in usage.

{img fileId="658" thumb="y" rel="box[g]"}

!! Metrics administration
By default, the metrics dashboard provides no metric. It only has basic mechanisms for collecting them based on user-provided SQL queries. Given access to the database, the dashboard can be used to monitor metrics from any application. External statistical packages can be used to generate the data.

{img fileId="659" thumb="y" rel="box[g]"}

In the administration panel, metrics and tabs can be defined. Tabs are only a form of organization to be used on the dashboard. Each metric can be on multiple tabs. The association between the tab and the metric is only used to collect the required data. The tab must also define a content block, containing a configuration of how to display each metric.

{img fileId="660" thumb="y" rel="box[g]"}

The metrics are basically named SQL queries with several parameters that can be included. Each metric must indicate the type of data that will be returned by the query, which will affect how the results are displayed.

{img fileId="661" thumb="y" rel="box[g]"}

The metric queries are expected to have a field called ''date_field'' when using the date related parameters. When no such field exists in the database, subqueries will often be required. Unlike most date fields in Tiki, the dates are expected to be in the DATETIME format, rather than UNIX timestamps. The conversion can be made using FROM_UNIXTIME().

{CODE(caption=Sample query: Pages modified)}
SELECT COUNT(*) as count, MIN(DATE(date_field)) date_field 
FROM (
    SELECT * 
    FROM (
        SELECT FROM_UNIXTIME(lastModif) as date_field 
        FROM tiki_pages
    ) pages 
    WHERE $date_range$
) changes 
$range_groupby$
{CODE}

{CODE(caption=Sample tab content block)}
{metric name="Pages modified" value="count" sparkline=true table=true trend=true toggle=true}
{CODE}



-=alias=-
(alias(Metrics Admin)) | (alias(MetricsDashBoard))