Create Analytics Metrics From Scheduled Queries
This page describes how to create analytics metrics from scheduled queries.
If you want to execute an analytics search repeatedly to monitor its value, you can create a metric from the search. The search will execute once per minute and report the results as a metric. You can create alerts on the metric in the usual way using Health Rules to trigger Policies and Actions. The analytics metric list is searchable.
You can create metrics for all Analytics event types - Browser, Mobile, Transaction, Log, and Custom.
You can create a metric from an analytics search for the functions shown in this table. SeeMetric Data Resolution over Time.
Function | Metric Rollup Type | Example |
---|---|---|
count(* | field_name) | sum | SELECT count( activeMacUsers) FROM dummyTransactions |
distinctcount(field_name) | average | SELECT distinctcount(activeMacUsers) FROM dummyTransactions |
sum(numeric_field_name) | sum | SELECT sum(responseTime)where userExperience = "NORMAL" FROM transactions |
avg(numeric_field_name) |
average | SELECT avg(responseTime) FROM transactions |
min(numeric_field_name) |
average | SELECT min(responseTime) FROM transactions |
max(numeric_field_name) |
average | SELECT max(responseTime) FROM transactions |
(exp1)/(exp2) | average |
SELECT (count(activeMacUsers)) / (avg(activeWindowsUsers)) FROM dummyTransactionsSELECT (avg(responseTime)*2)/((avg(segments.transactionTime)+3)/2) FROM transactionsSELECT (sum(responseTime)*2)/(filter(sum(responseTime), where userExperience = "NORMAL") + 0.5) FROM transactions Note: Each side of the expression must be enclosed in parenthesis.
|