LAST_COUNT_EVENTS

Count how many events have been triggered within a time window between now and a date in the past determined by the provided duration.

Usage

LAST_COUNT_EVENTS(eventListName, duration)

Parameters

eventListName

String

The name of the collection to count events for.

duration

String

A string representing a duration (expressed in the ISO 8601 format).

Returns

Number

Examples

LAST_COUNT_EVENTS(‘MyColl’, ‘P7D’)

Count events in MyColl fired in the past 7 days.

LAST_COUNT_EVENTS(‘MyColl’, ‘GETDURATIONFROMSEC(60)’)

Count events in MyColl fired in the past 60 seconds.

LAST_COUNT_EVENTS(‘MyColl’, ‘PT1H’)

Count events in MyColl fired in the past hour.

Remarks

If the provided collection name does not exist, the function will return 0.