Specifying Profile Time and Duration
The third required argument for PROFILE_GET
is a list of
ProfilePeriod
objects. These objects allow you to specify the timing,
frequency, and duration of the PROFILE_GET
. This list is produced by another
Stellar function. There are two options available: PROFILE_FIXED
and
PROFILE_WINDOW
.
- PROFILE_FIXED
PROFILE_FIXED
specifies a fixed period to look back at the profiler data starting from now. These are ProfilePeriod objects.- REQUIRED:
-
- durationAgo
- How long ago should values be retrieved from?
- units
- The units of 'durationAgo'.
- OPTIONAL:
-
- config_overrides
- Map (in curly braces) of name:value pairs, each overriding the global config parameter of the same name. Default is the empty Map, meaning no overrides.
- PROFILE WINDOW
PROFILE_WINDOW
provides a finer-level of control over selecting windows for profiles. This profile selector allows you to specify the exact time, duration, and frequency for the profile. It does this by a domain specific language that mimics natural language that defines the excluded windows. You can usePROFILE_WINDOW
to specify:- Windows relative to the data timestamp (see the optional
now
parameter below) - Non-contiguous windows to better handle seasonal data (for example, the last hour for every day for the last month)
- Profile output excluding holidays
- Only profile output on a specific day of the week
- Windows relative to the data timestamp (see the optional
- REQUIRED:
-
- windowSelector
- The statement specifying the window to select.
- now
- Optional - The timestamp to use for now.
- OPTIONAL:
-
- config_overrides
- Map (in curly braces) of name:value pairs, each overriding the global config parameter of the same name. Default is the empty Map, meaning no overrides.
For example, to retrieve all the measurements written for 'profile' and 'entity' for the
last hour on the same weekday excluding weekends and US holidays across the last 14 days:
PROFILE_GET('profile', 'entity', PROFILE_WINDOW('1 hour window every 24 hours starting from 14 days ago including the current day of the week excluding weekends, holidays:us'))
Note | |
---|---|
The config_overrides parameter operates exactly as the
config_overrides argument in PROFILE_GET . The
only available parameters for override are:
|