Skip to main content

Module map_time

Module map_time 

Source
Expand description

time() and the date functions over evaluated series, following Prometheus funcTime and dateWrapper.

Structsยง

Civil ๐Ÿ”’

Enumsยง

DateFunction
A PromQL date function: minute(v), year() and so on.
QueryContextFunction
start(), end(), range() and step(): constants of a query, which Prometheus folds into number literals before evaluating it.

Constantsยง

ABSOLUTE_YEARS ๐Ÿ”’
MARCH_THRU_DECEMBER ๐Ÿ”’
SECONDS_PER_DAY ๐Ÿ”’
UNIX_TO_ABSOLUTE ๐Ÿ”’
Goโ€™s unixToInternal + internalToAbsolute.

Functionsยง

civil ๐Ÿ”’
Goโ€™s absDays.split, date and yearYday: days since March 1 of year -ABSOLUTE_YEARS.
date_of_eval_time
A date function without argument, which reads the evaluation time: one unlabelled series over the whole grid.
duration_seconds ๐Ÿ”’
Goโ€™s time.Duration.Seconds of ms milliseconds: whole seconds plus the remainder over 1e9, two roundings rather than one division. The nanosecond count saturates as time.Time.Sub does.
eval_time_series ๐Ÿ”’
go_int64 ๐Ÿ”’
Goโ€™s int64(f) on amd64: NaN and values out of range become i64::MIN.
time
time(): the evaluation time in seconds at every point of the schemaโ€™s grid, unlabelled.