Loading Stats events from the database
Last updated
Was this helpful?
Last updated
Was this helpful?
Just like when loading SystemLogEvents from the database, you can use the provided StatsEvents class to retrieve and work with lists of StatsEvent objects.
For example, let's load the last fifty StatsEventHomeView
objects from our earlier example, using what we learned in the Item lists section of the Items guide:
As you can see, the class accepts some additional keys on top of the usual keys:
type
Retrieves only StatsEvent objects of this class name. Must include the full namespace route to the class.
fromTimestamp
Retrieves StatsEvent objects triggered after this timestamp.
toTimestamp
Retrieves StatsEvent objects triggered up to this timestamp.
See examples of loading StatsEvent object from the database in the Triggering a stats event and Events with additional dimensions examples.