TRY ME

Try Valo for free

We want to show you something amazing.

We'll send you a link to download a fully functional Valo copy to play with.



Great! Check your email and enjoy Valo



Apologies, we seem to be having a problem processing your input, please try again

Function Reference

isNull(string)

True if the value is null.

Signature:

(string): boolean

Arguments:
  • v (string) – arg0
Returns:

boolean

length(string)

The length of the string (in characters, not bytes)

Signature:

(string): int

Arguments:
  • string (string) – arg0
Returns:

int

concat(string, string)

Concatenates two strings.

Signature:

(string, string): string

Arguments:
  • string (string) – arg0
  • other (string) – arg1
Returns:

string

prefix(string, string)

True if the string is prefixed by the specified character sequence.

Signature:

(string, string): boolean

Arguments:
  • string (string) – arg0
  • sequence (string) – arg1
Returns:

boolean

contains(string, string)

True if the string contains the character sequence.

Signature:

(string, string): boolean

Arguments:
  • string (string) – arg0
  • sequence (string) – arg1
Returns:

boolean

toUpper(string)

Converts the string to upper case.

Signature:

(string): string

Arguments:
  • string (string) – arg0
Returns:

string

toLower(string)

Converts the string to lower case.

Signature:

(string): string

Arguments:
  • string (string) – arg0
Returns:

string

toRadians(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

toDegrees(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

tanh(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

tan(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

sqrt(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

sinh(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

sin(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

pow(double, double)
Signature:

(double, double): double

Arguments:
  • x (double) – arg0
  • y (double) – arg1
Returns:

double

log1p(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

log10(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

log(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

hypot(double, double)
Signature:

(double, double): double

Arguments:
  • x (double) – arg0
  • y (double) – arg1
Returns:

double

floor(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

expm1(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

exp(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

cosh(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

cos(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

ceil(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

cbrt(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

atan2(double, double)
Signature:

(double, double): double

Arguments:
  • y (double) – arg0
  • x (double) – arg1
Returns:

double

atan(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

asin(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

acos(double)
Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

min(double, double)

Returns the min value.

Signature:

(double, double): double

Arguments:
  • v1 (double) – arg0
  • v2 (double) – arg1
Returns:

double

min(long, long)

Returns the min value.

Signature:

(long, long): long

Arguments:
  • v1 (long) – arg0
  • v2 (long) – arg1
Returns:

long

min(int, int)

Returns the min value.

Signature:

(int, int): int

Arguments:
  • v1 (int) – arg0
  • v2 (int) – arg1
Returns:

int

min(short, short)

Returns the min value.

Signature:

(short, short): int

Arguments:
  • v1 (short) – arg0
  • v2 (short) – arg1
Returns:

int

min(byte, byte)

Returns the min value.

Signature:

(byte, byte): int

Arguments:
  • v1 (byte) – arg0
  • v2 (byte) – arg1
Returns:

int

max(double, double)

Returns the max value.

Signature:

(double, double): double

Arguments:
  • v1 (double) – arg0
  • v2 (double) – arg1
Returns:

double

max(long, long)

Returns the max value.

Signature:

(long, long): long

Arguments:
  • v1 (long) – arg0
  • v2 (long) – arg1
Returns:

long

max(int, int)

Returns the max value.

Signature:

(int, int): int

Arguments:
  • v1 (int) – arg0
  • v2 (int) – arg1
Returns:

int

max(short, short)

Returns the max value.

Signature:

(short, short): int

Arguments:
  • v1 (short) – arg0
  • v2 (short) – arg1
Returns:

int

max(byte, byte)

Returns the max value.

Signature:

(byte, byte): int

Arguments:
  • v1 (byte) – arg0
  • v2 (byte) – arg1
Returns:

int

abs(double)

Returns the absolute value.

Signature:

(double): double

Arguments:
  • v (double) – arg0
Returns:

double

abs(long)

Returns the absolute value.

Signature:

(long): long

Arguments:
  • v (long) – arg0
Returns:

long

abs(int)

Returns the absolute value.

Signature:

(int): int

Arguments:
  • v (int) – arg0
Returns:

int

abs(short)

Returns the absolute value.

Signature:

(short): int

Arguments:
  • v (short) – arg0
Returns:

int

abs(byte)

Returns the absolute value.

Signature:

(byte): int

Arguments:
  • v (byte) – arg0
Returns:

int

ifNull(byte, byte)

If null, use the given value.

Signature:

(byte, byte): byte

Arguments:
  • v (byte) – arg0
  • value (byte) – arg1
Returns:

byte

isNull(byte)

True if the value is null.

Signature:

(byte): boolean

Arguments:
  • v (byte) – arg0
Returns:

boolean

toByte(double)

Converts the value to a byte.

Signature:

(double): byte

Arguments:
  • v (double) – arg0
Returns:

byte

toByte(long)

Converts the value to a byte.

Signature:

(long): byte

Arguments:
  • v (long) – arg0
Returns:

byte

toByte(int)

Converts the value to a byte.

Signature:

(int): byte

Arguments:
  • v (int) – arg0
Returns:

byte

toByte(short)

Converts the value to a byte.

Signature:

(short): byte

Arguments:
  • v (short) – arg0
Returns:

byte

toByte(boolean)

Converts the value to a byte.

Signature:

(boolean): byte

Arguments:
  • v (boolean) – arg0
Returns:

byte

toByte(string)

Converts the value to a byte.

Signature:

(string): byte

Arguments:
  • txt (string) – arg0
Returns:

byte

ifNull(short, short)

If null, use the given value.

Signature:

(short, short): short

Arguments:
  • v (short) – arg0
  • value (short) – arg1
Returns:

short

isNull(short)

True if the value is null.

Signature:

(short): boolean

Arguments:
  • v (short) – arg0
Returns:

boolean

toShort(double)

Converts the value to a short.

Signature:

(double): short

Arguments:
  • v (double) – arg0
Returns:

short

toShort(long)

Converts the value to a short.

Signature:

(long): short

Arguments:
  • v (long) – arg0
Returns:

short

toShort(int)

Converts the value to a short.

Signature:

(int): short

Arguments:
  • v (int) – arg0
Returns:

short

toShort(byte)

Converts the value to a short.

Signature:

(byte): short

Arguments:
  • v (byte) – arg0
Returns:

short

toShort(boolean)

Converts the value to a short.

Signature:

(boolean): short

Arguments:
  • v (boolean) – arg0
Returns:

short

toShort(string)

Converts the value to an short.

Signature:

(string): short

Arguments:
  • txt (string) – arg0
Returns:

short

ifNull(int, int)

If null, use the given value.

Signature:

(int, int): int

Arguments:
  • v (int) – arg0
  • value (int) – arg1
Returns:

int

isNull(int)

True if the value is null.

Signature:

(int): boolean

Arguments:
  • v (int) – arg0
Returns:

boolean

toInt(double)

Converts the value to an int.

Signature:

(double): int

Arguments:
  • v (double) – arg0
Returns:

int

toInt(long)

Converts the value to an int.

Signature:

(long): int

Arguments:
  • v (long) – arg0
Returns:

int

toInt(short)

Converts the value to an int.

Signature:

(short): int

Arguments:
  • v (short) – arg0
Returns:

int

toInt(byte)

Converts the value to an int.

Signature:

(byte): int

Arguments:
  • v (byte) – arg0
Returns:

int

toInt(boolean)

Converts the value to an int.

Signature:

(boolean): int

Arguments:
  • v (boolean) – arg0
Returns:

int

toInt(string)

Converts the value to an int.

Signature:

(string): int

Arguments:
  • txt (string) – arg0
Returns:

int

ifNull(long, long)

If null, use the given value.

Signature:

(long, long): long

Arguments:
  • v (long) – arg0
  • value (long) – arg1
Returns:

long

isNull(long)

True if the value is null.

Signature:

(long): boolean

Arguments:
  • v (long) – arg0
Returns:

boolean

toLong(double)

Converts the value to a long.

Signature:

(double): long

Arguments:
  • v (double) – arg0
Returns:

long

toLong(int)

Converts the value to a long.

Signature:

(int): long

Arguments:
  • v (int) – arg0
Returns:

long

toLong(short)

Converts the value to a long.

Signature:

(short): long

Arguments:
  • v (short) – arg0
Returns:

long

toLong(byte)

Converts the value to a long.

Signature:

(byte): long

Arguments:
  • v (byte) – arg0
Returns:

long

toLong(boolean)

Converts the value to a long.

Signature:

(boolean): long

Arguments:
  • v (boolean) – arg0
Returns:

long

toLong(string)

Converts the value to an long.

Signature:

(string): long

Arguments:
  • txt (string) – arg0
Returns:

long

ifNull(double, double)

If null, use the given value.

Signature:

(double, double): double

Arguments:
  • v (double) – arg0
  • value (double) – arg1
Returns:

double

isNull(double)

True if the value is null.

Signature:

(double): boolean

Arguments:
  • v (double) – arg0
Returns:

boolean

isPosInfinity(double)

Checks if the double value is +Infinity.

Signature:

(double): boolean

Arguments:
  • v (double) – arg0
Returns:

boolean

isNegInfinity(double)

Checks if the double value is -Infinity

Signature:

(double): boolean

Arguments:
  • v (double) – arg0
Returns:

boolean

isInfinity(double)

Checks if the double value is Infinity

Signature:

(double): boolean

Arguments:
  • v (double) – arg0
Returns:

boolean

isNan(double)

Checks if the double value is NaN

Signature:

(double): boolean

Arguments:
  • v (double) – arg0
Returns:

boolean

toDouble(long)

Converts the value to a double.

Signature:

(long): double

Arguments:
  • v (long) – arg0
Returns:

double

toDouble(int)

Converts the value to a double.

Signature:

(int): double

Arguments:
  • v (int) – arg0
Returns:

double

toDouble(short)

Converts the value to a double.

Signature:

(short): double

Arguments:
  • v (short) – arg0
Returns:

double

toDouble(byte)

Converts the value to a double.

Signature:

(byte): double

Arguments:
  • v (byte) – arg0
Returns:

double

toDouble(boolean)

Converts the value to a double.

Signature:

(boolean): double

Arguments:
  • v (boolean) – arg0
Returns:

double

toDouble(string)

Converts the value to a double.

Signature:

(string): double

Arguments:
  • txt (string) – arg0
Returns:

double

ifNull(date, date)

If null, use the given value.

Signature:

(date, date): date

Arguments:
  • v (date) – arg0
  • value (date) – arg1
Returns:

date

isNull(date)

True if the value is null.

Signature:

(date): boolean

Arguments:
  • v (date) – arg0
Returns:

boolean

ordinal(int, int, date)

Calculates a date based on a ordinal position and within the month and year given by the last parameter

Signature:

(int, int, date): date

Arguments:
  • pos (int) – arg0
  • dayOfWeek (int) – arg1
  • v (date) – arg2
Returns:

date

ordinal(int, int, int, int)

Calculates a date based on a ordinal position

Signature:

(int, int, int, int): date

Arguments:
  • pos (int) – arg0
  • dayOfWeek (int) – arg1
  • month (int) – arg2
  • year (int) – arg3
Returns:

date

diff(date, date)

Gets the difference between two dates as a duration

Signature:

(date, date): duration

Arguments:
  • v (date) – arg0
  • ref (date) – arg1
Returns:

duration

plus(date, duration)

Adds a duration

Signature:

(date, duration): datetime

Arguments:
  • v (date) – arg0
  • ref (duration) – arg1
Returns:

datetime

minus(date, duration)

Subtracts a duration

Signature:

(date, duration): datetime

Arguments:
  • v (date) – arg0
  • ref (duration) – arg1
Returns:

datetime

weekOfYear(date)

Returns the week of the year

Signature:

(date): int

Arguments:
  • v (date) – arg0
Returns:

int

weekOfMonth(date)

Returns the week of the month

Signature:

(date): int

Arguments:
  • v (date) – arg0
Returns:

int

isAfter(date, date)

Returns true if the first data is after the reference date

Signature:

(date, date): boolean

Arguments:
  • v (date) – arg0
  • ref (date) – arg1
Returns:

boolean

isBefore(date, date)

Returns true if the first date is before the reference date

Signature:

(date, date): boolean

Arguments:
  • v (date) – arg0
  • ref (date) – arg1
Returns:

boolean

dayOfYear(date)

Returns the day-of-year, from 1 to 365, or 366 in a leap year

Signature:

(date): int

Arguments:
  • v (date) – arg0
Returns:

int

dayOfWeekValue(date)

Returns the day-of-week, as number, where 1 is Monday

Signature:

(date): int

Arguments:
  • v (date) – arg0
Returns:

int

dayOfWeek(date)

Returns the day-of-week, as string

Signature:

(date): string

Arguments:
  • v (date) – arg0
Returns:

string

day(date)

Returns the day-of-month, from 1 to 31

Signature:

(date): int

Repositories:

[ssr]

Arguments:
  • v (date) – arg0
Returns:

int

lengthOfMonth(date)

Returns the length of the month in days

Signature:

(date): int

Arguments:
  • v (date) – arg0
Returns:

int

month(date)

Returns the number of the month, 1 to 12

Signature:

(date): int

Repositories:

[ssr]

Arguments:
  • v (date) – arg0
Returns:

int

nameOfMonth(date)

Returns the name of the month, as string

Signature:

(date): string

Arguments:
  • v (date) – arg0
Returns:

string

isLeapYear(date)

Returns true if the year is leap, false otherwise

Signature:

(date): boolean

Arguments:
  • v (date) – arg0
Returns:

boolean

lengthOfYear(date)

Returns the length of the year in days, either 365 or 366

Signature:

(date): int

Arguments:
  • v (date) – arg0
Returns:

int

year(date)

Returns the year of the date

Signature:

(date): int

Repositories:

[ssr]

Arguments:
  • v (date) – arg0
Returns:

int

utcTomorrow()

Returns one day more than the current date at UTC

Signature:(): date
Returns:date
utcYesterday()

Returns one day less than the current date at UTC

Signature:(): date
Returns:date
utcDate()

Returns the current date at UTC

Signature:(): date
Returns:date
toDateTime(date)

Converts a date to a datetime.

Signature:

(date): datetime

Arguments:
  • v (date) – arg0
Returns:

datetime

date(string)

Constructs a date object.

Signature:

(string): date

Arguments:
  • txt (string) – arg0
Returns:

date

startOfSecond(datetime)

Strips sub-second information from the date time

Signature:

(datetime): datetime

Arguments:
  • v (datetime) – arg0
Returns:

datetime

startOfMinute(datetime)

Strips second and sub-second information from the date time

Signature:

(datetime): datetime

Arguments:
  • v (datetime) – arg0
Returns:

datetime

startOfHour(datetime)

Strips minute, second and sub-second information from the date time

Signature:

(datetime): datetime

Arguments:
  • v (datetime) – arg0
Returns:

datetime

ifNull(datetime, datetime)

If null, use the given value.

Signature:

(datetime, datetime): datetime

Arguments:
  • v (datetime) – arg0
  • value (datetime) – arg1
Returns:

datetime

isNull(datetime)

True if the value is null.

Signature:

(datetime): boolean

Arguments:
  • v (datetime) – arg0
Returns:

boolean

format(datetime, string)

Formats the datetime into a string

Signature:

(datetime, string): string

Arguments:
  • v (datetime) – arg0
  • format (string) – arg1
Returns:

string

diff(datetime, date)

Gets the difference between two dates as a duration

Signature:

(datetime, date): duration

Arguments:
  • v (datetime) – arg0
  • ref (date) – arg1
Returns:

duration

diff(datetime, datetime)

Gets the difference between two dates as a duration

Signature:

(datetime, datetime): duration

Arguments:
  • v (datetime) – arg0
  • ref (datetime) – arg1
Returns:

duration

plus(datetime, duration)

Subtracts a duration

Signature:

(datetime, duration): datetime

Arguments:
  • v (datetime) – arg0
  • ref (duration) – arg1
Returns:

datetime

minus(datetime, duration)

Subtracts a duration

Signature:

(datetime, duration): datetime

Arguments:
  • v (datetime) – arg0
  • ref (duration) – arg1
Returns:

datetime

secondOfDay(datetime)

Gets the second of the day

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

minuteOfDay(datetime)

Gets the minute of the day

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

nano(datetime)

Gets the fractional second in nano units

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

second(datetime)

Gets the second.

Signature:

(datetime): int

Repositories:

[ssr]

Arguments:
  • v (datetime) – arg0
Returns:

int

minute(datetime)

Gets the minute.

Signature:

(datetime): int

Repositories:

[ssr]

Arguments:
  • v (datetime) – arg0
Returns:

int

hour(datetime)

Gets the hour.

Signature:

(datetime): int

Repositories:

[ssr]

Arguments:
  • v (datetime) – arg0
Returns:

int

weekOfYear(datetime)

Returns the week of the year

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

weekOfMonth(datetime)

Returns the week of the month

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

isAfter(datetime, datetime)

Returns true if the first data is after the reference date

Signature:

(datetime, datetime): boolean

Arguments:
  • v (datetime) – arg0
  • ref (datetime) – arg1
Returns:

boolean

isBefore(datetime, datetime)

Returns true if the first date is before the reference date

Signature:

(datetime, datetime): boolean

Arguments:
  • v (datetime) – arg0
  • ref (datetime) – arg1
Returns:

boolean

dayOfYear(datetime)

Gets the day of year.

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

dayOfWeekValue(datetime)

Returns the day-of-week, as number, where 1 is Monday

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

dayOfWeek(datetime)

Gets the day of week.

Signature:

(datetime): string

Arguments:
  • v (datetime) – arg0
Returns:

string

day(datetime)

Gets the day.

Signature:

(datetime): int

Repositories:

[ssr]

Arguments:
  • v (datetime) – arg0
Returns:

int

lengthOfMonth(datetime)

Returns the length of the month in days

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

nameOfMonth(datetime)

Returns the name of the month, as string

Signature:

(datetime): string

Arguments:
  • v (datetime) – arg0
Returns:

string

month(datetime)

Gets the month.

Signature:

(datetime): int

Repositories:

[ssr]

Arguments:
  • v (datetime) – arg0
Returns:

int

isLeapYear(datetime)

Returns true if the year is leap, false otherwise

Signature:

(datetime): boolean

Arguments:
  • v (datetime) – arg0
Returns:

boolean

lengthOfYear(datetime)

Returns the length of the year in days, either 365 or 366

Signature:

(datetime): int

Arguments:
  • v (datetime) – arg0
Returns:

int

year(datetime)

Gets the year.

Signature:

(datetime): int

Repositories:

[ssr]

Arguments:
  • v (datetime) – arg0
Returns:

int

toTime(datetime)

Converts a datetime to a time.

Signature:

(datetime): time

Arguments:
  • v (datetime) – arg0
Returns:

time

toDate(datetime)

Converts a datetime to a date.

Signature:

(datetime): date

Arguments:
  • v (datetime) – arg0
Returns:

date

utcNow()

Returns UTC current timestamp

Signature:(): datetime
Returns:datetime
datetime(string)

Constructs a date object.

Signature:

(string): datetime

Arguments:
  • txt (string) – arg0
Returns:

datetime

startOfSecond(time)

Strips sub-second information from the time

Signature:

(time): time

Arguments:
  • v (time) – arg0
Returns:

time

startOfMinute(time)

Strips second and sub-second information from the time

Signature:

(time): time

Arguments:
  • v (time) – arg0
Returns:

time

startOfHour(time)

Strips minute, second and sub-second information from the time

Signature:

(time): time

Arguments:
  • v (time) – arg0
Returns:

time

ifNull(time, time)

If null, use the given value.

Signature:

(time, time): time

Arguments:
  • v (time) – arg0
  • value (time) – arg1
Returns:

time

isNull(time)

True if the value is null.

Signature:

(time): boolean

Arguments:
  • v (time) – arg0
Returns:

boolean

diff(time, time)

Gets the difference between two dates as a times

Signature:

(time, time): duration

Arguments:
  • v (time) – arg0
  • ref (time) – arg1
Returns:

duration

plus(time, duration)

Subtracts a duration

Signature:

(time, duration): time

Arguments:
  • v (time) – arg0
  • ref (duration) – arg1
Returns:

time

minus(time, duration)

Subtracts a duration

Signature:

(time, duration): time

Arguments:
  • v (time) – arg0
  • ref (duration) – arg1
Returns:

time

secondOfDay(time)

Gets the second of the day

Signature:

(time): int

Arguments:
  • v (time) – arg0
Returns:

int

minuteOfDay(time)

Gets the minute of the day

Signature:

(time): int

Arguments:
  • v (time) – arg0
Returns:

int

nano(time)

Gets the fractional second in nano units.

Signature:

(time): int

Arguments:
  • v (time) – arg0
Returns:

int

second(time)

Gets the second.

Signature:

(time): int

Repositories:

[ssr]

Arguments:
  • v (time) – arg0
Returns:

int

minute(time)

Gets the minute.

Signature:

(time): int

Repositories:

[ssr]

Arguments:
  • v (time) – arg0
Returns:

int

hour(time)

Gets the hour.

Signature:

(time): int

Repositories:

[ssr]

Arguments:
  • v (time) – arg0
Returns:

int

time(string)

Constructs a time object.

Signature:

(string): time

Arguments:
  • txt (string) – arg0
Returns:

time

ifNull(uuid, uuid)

If null, use the given value.

Signature:

(uuid, uuid): uuid

Arguments:
  • v (uuid) – arg0
  • value (uuid) – arg1
Returns:

uuid

isNull(uuid)

True if the value is null.

Signature:

(uuid): boolean

Arguments:
  • v (uuid) – arg0
Returns:

boolean

version(uuid)

The version number describing how this UUID was generated

Signature:

(uuid): int

Arguments:
  • value (uuid) – arg0
Returns:

int

variant(uuid)

The variant number describing the layout of the UUID

Signature:

(uuid): int

Arguments:
  • value (uuid) – arg0
Returns:

int

toString(uuid)

Converts a UUID to String.

Signature:

(uuid): string

Arguments:
  • value (uuid) – arg0
Returns:

string

uuid(string)

Converts a string to a UUID.

Signature:

(string): uuid

Arguments:
  • txt (string) – arg0
Returns:

uuid

ifNull(duration, duration)

If null, use the given value.

Signature:

(duration, duration): duration

Arguments:
  • v (duration) – arg0
  • value (duration) – arg1
Returns:

duration

isNull(duration)

True if the value is null.

Signature:

(duration): boolean

Arguments:
  • v (duration) – arg0
Returns:

boolean

diff(duration, duration)

Gets the difference between two durations as a duration

Signature:

(duration, duration): duration

Arguments:
  • v (duration) – arg0
  • ref (duration) – arg1
Returns:

duration

nanos(duration)

Gets the length of the duration measured in whole nanoseconds.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

micros(duration)

Gets the length of the duration measured in whole microseconds.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

millis(duration)

Gets the length of the duration measured in whole milliseconds.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

seconds(duration)

Gets the length of the duration measured in whole seconds.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

minutes(duration)

Gets the length of the duration measured in whole minutes.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

hours(duration)

Gets the length of the duration measured in whole hours.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

days(duration)

Gets the length of the duration measured in whole days.

Signature:

(duration): long

Arguments:
  • v (duration) – arg0
Returns:

long

duration(int, int, int, double)

Builds an arbitrary duration

Signature:

(int, int, int, double): duration

Arguments:
  • days (int) – arg0
  • hours (int) – arg1
  • minutes (int) – arg2
  • seconds (double) – arg3
Returns:

duration

duration(string)

Constructs a date object.

Signature:

(string): duration

Arguments:
  • txt (string) – arg0
Returns:

duration

ifNull(uri, uri)

If null, use the given value.

Signature:

(uri, uri): uri

Arguments:
  • v (uri) – arg0
  • value (uri) – arg1
Returns:

uri

isNull(uri)

True if the value is null.

Signature:

(uri): boolean

Arguments:
  • v (uri) – arg0
Returns:

boolean

getFragment(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

getQuery(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

getPath(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

getPort(uri)
Signature:

(uri): int

Arguments:
  • value (uri) – arg0
Returns:

int

getHost(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

getUserInfo(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

getAuthority(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

isOpaque(uri)
Signature:

(uri): boolean

Arguments:
  • value (uri) – arg0
Returns:

boolean

isAbsolute(uri)
Signature:

(uri): boolean

Arguments:
  • value (uri) – arg0
Returns:

boolean

getScheme(uri)
Signature:

(uri): string

Arguments:
  • value (uri) – arg0
Returns:

string

uri(string)

Converts a string to a Uri.

Signature:

(string): uri

Arguments:
  • string (string) – arg0
Returns:

uri

ifNull(boolean, boolean)

If null, use the given value.

Signature:

(boolean, boolean): boolean

Arguments:
  • v (boolean) – arg0
  • value (boolean) – arg1
Returns:

boolean

isNull(boolean)

True if the value is null.

Signature:

(boolean): boolean

Arguments:
  • v (boolean) – arg0
Returns:

boolean

I(boolean)

The indicator function. Returns 1 if true, otherwise 0

Signature:

(boolean): int

Arguments:
  • predicate (boolean) – arg0
Returns:

int

toBool(double)

Converts the value to a boolean.

Signature:

(double): boolean

Arguments:
  • v (double) – arg0
Returns:

boolean

toBool(long)

Converts the value to a boolean.

Signature:

(long): boolean

Arguments:
  • v (long) – arg0
Returns:

boolean

toBool(int)

Converts the value to a boolean.

Signature:

(int): boolean

Arguments:
  • v (int) – arg0
Returns:

boolean

toBool(short)

Converts the value to a boolean.

Signature:

(short): boolean

Arguments:
  • v (short) – arg0
Returns:

boolean

toBool(byte)

Converts the value to a boolean.

Signature:

(byte): boolean

Arguments:
  • v (byte) – arg0
Returns:

boolean

toBool(string)

Converts the value to a boolean.

Signature:

(string): boolean

Arguments:
  • txt (string) – arg0
Returns:

boolean

ifNull(ip, ip)

If null, use the given value.

Signature:

(ip, ip): ip

Arguments:
  • v (ip) – arg0
  • value (ip) – arg1
Returns:

ip

isNull(ip)

True if the value is null.

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isSiteMulticastAddress(ip)

Returns true if the multicast address has site scope

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isOrganisationMulticastAddress(ip)

Returns true if the multicast address has organization scope

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isNodeLocalMulticastAddress(ip)

Returns true if the multicast address has node scope

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isLinkLocalMulticastAddress(ip)

Returns true if the multicast address has link scope

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isGlobalMulticastAddress(ip)

Returns true if the multicast address has global scope

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isIPv4Mapped(ip)

Returns true if the address is an IPv4 mapped as IPv6

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isMulticastAddress(ip)

Returns true if the address is multicast

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

multicastKind(ip)

Returns a string with the type of multicast address.

Signature:

(ip): string

Arguments:
  • v (ip) – arg0
Returns:

string

kind(ip)

Returns a string with the type of address. Only IPv4 or IPv6 are recognised

Signature:

(ip): string

Arguments:
  • v (ip) – arg0
Returns:

string

isIPv4(ip)

Returns true if the address is an IPv4

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isIPv6(ip)

Returns true if the address is an IPv6

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

isLoopbackAddress(ip)

Returns true if the address is an IPv4 or IPv6 loopback address, returns false otherwise.

Signature:

(ip): boolean

Arguments:
  • v (ip) – arg0
Returns:

boolean

inetAddressByName(string)

Creates an inet address based on a host name.

Signature:

(string): ip

Arguments:
  • host (string) – arg0
Returns:

ip

inetAddress(string)

Parses an inet address in textual format

Signature:

(string): ip

Arguments:
  • address (string) – arg0
Returns:

ip

ifNull(contributor, contributor)

If null, use the given value.

Signature:

(contributor, contributor): contributor

Arguments:
  • v (contributor) – arg0
  • value (contributor) – arg1
Returns:

contributor

isNull(contributor)

True if the value is null.

Signature:

(contributor): boolean

Arguments:
  • v (contributor) – arg0
Returns:

boolean

contributor(string)

Constructs a contributor object.

Signature:

(string): contributor

Arguments:
  • txt (string) – arg0
Returns:

contributor

ifNull(geoCircle, geoCircle)

If null, use the given value.

Signature:

(geoCircle, geoCircle): geoCircle

Arguments:
  • v (geoCircle) – arg0
  • value (geoCircle) – arg1
Returns:

geoCircle

isNull(geoCircle)

True if the value is null.

Signature:

(geoCircle): boolean

Arguments:
  • v (geoCircle) – arg0
Returns:

boolean

contains(geoPoint, geoCircle)

Is the point within a circle

Signature:

(geoPoint, geoCircle): boolean

Arguments:
  • p (geoPoint) – arg0
  • v (geoCircle) – arg1
Returns:

boolean

relate(geoPoint, geoCircle)

Relates a point with a circle

Signature:

(geoPoint, geoCircle): string

Arguments:
  • p (geoPoint) – arg0
  • v (geoCircle) – arg1
Returns:

string

boundingBox(geoCircle)

Gets a bounding box for the circle

Signature:

(geoCircle): geoRectangle

Arguments:
  • v (geoCircle) – arg0
Returns:

geoRectangle

radiusKM(geoCircle)

Gets the radius of the circle in Km.

Signature:

(geoCircle): double

Arguments:
  • v (geoCircle) – arg0
Returns:

double

radiusDEG(geoCircle)

Gets the radius of the circle in degrees.

Signature:

(geoCircle): double

Arguments:
  • v (geoCircle) – arg0
Returns:

double

centerLatitude(geoCircle)

Gets the latitude of the centre of the circle in degrees.

Signature:

(geoCircle): double

Arguments:
  • v (geoCircle) – arg0
Returns:

double

centerLongitude(geoCircle)

Gets the longitude of the centre of the circle in degrees.

Signature:

(geoCircle): double

Arguments:
  • v (geoCircle) – arg0
Returns:

double

geoCircle(geoPoint, geoPoint)

Creates a Geo circle the coordinates of its center and another point

Signature:

(geoPoint, geoPoint): geoCircle

Arguments:
  • center (geoPoint) – arg0
  • otherPoint (geoPoint) – arg1
Returns:

geoCircle

geoCircle(geoPoint, double)

Creates a Geo circle the coordinates of its center and a radius

Signature:

(geoPoint, double): geoCircle

Arguments:
  • center (geoPoint) – arg0
  • radiusInKm (double) – arg1
Returns:

geoCircle

geoCircle(double, double, double)

Creates a Geo circle the coordinates of its center and a radius

Signature:

(double, double, double): geoCircle

Arguments:
  • long (double) – arg0
  • lat (double) – arg1
  • radiusInKm (double) – arg2
Returns:

geoCircle

geoCircle(string)

Creates a Geo circle by passing a string like [38.898648N 77.037692W 10.0]

Signature:

(string): geoCircle

Arguments:
  • str (string) – arg0
Returns:

geoCircle

ifNull(geoPoint, geoPoint)

If null, use the given value.

Signature:

(geoPoint, geoPoint): geoPoint

Arguments:
  • v (geoPoint) – arg0
  • value (geoPoint) – arg1
Returns:

geoPoint

isNull(geoPoint)

True if the value is null.

Signature:

(geoPoint): boolean

Arguments:
  • v (geoPoint) – arg0
Returns:

boolean

pointOnBearing(geoPoint, double, double)

Returns location as reported at a distance and bearing from a known point

Signature:

(geoPoint, double, double): geoPoint

Arguments:
  • from (geoPoint) – arg0
  • dist (double) – arg1
  • bearingDeg (double) – arg2
Returns:

geoPoint

distance(geoPoint, geoPoint)

Gets distance between two geographical points in km, using Haversine and earth mean radius – 6371.0087714 Km

Signature:

(geoPoint, geoPoint): double

Arguments:
  • a (geoPoint) – arg0
  • b (geoPoint) – arg1
Returns:

double

distanceDEG(geoPoint, geoPoint)

Gets distance between two geographical points in degrees, using Haversine.

Signature:

(geoPoint, geoPoint): double

Arguments:
  • a (geoPoint) – arg0
  • b (geoPoint) – arg1
Returns:

double

latitude(geoPoint)

Gets the latitude of the point in degrees.

Signature:

(geoPoint): double

Arguments:
  • v (geoPoint) – arg0
Returns:

double

longitude(geoPoint)

Gets the longitude of the point in degrees.

Signature:

(geoPoint): double

Arguments:
  • v (geoPoint) – arg0
Returns:

double

geoPoint(double, double)

Creates a Geo Point by longitude and latitude

Signature:

(double, double): geoPoint

Arguments:
  • long (double) – arg0
  • lat (double) – arg1
Returns:

geoPoint

geoPoint(string)

Creates a Geo Point by passing a string like [28.898648N 77.037692W]

Signature:

(string): geoPoint

Arguments:
  • str (string) – arg0
Returns:

geoPoint

ifNull(geoRectangle, geoRectangle)

If null, use the given value.

Signature:

(geoRectangle, geoRectangle): geoRectangle

Arguments:
  • v (geoRectangle) – arg0
  • value (geoRectangle) – arg1
Returns:

geoRectangle

isNull(geoRectangle)

True if the value is null.

Signature:

(geoRectangle): boolean

Arguments:
  • v (geoRectangle) – arg0
Returns:

boolean

contains(geoPoint, geoRectangle)

Is the point within a rectangle

Signature:

(geoPoint, geoRectangle): boolean

Arguments:
  • p (geoPoint) – arg0
  • v (geoRectangle) – arg1
Returns:

boolean

relate(geoPoint, geoRectangle)

Relates a point with a rectangle

Signature:

(geoPoint, geoRectangle): string

Arguments:
  • p (geoPoint) – arg0
  • v (geoRectangle) – arg1
Returns:

string

crossesDateLine(geoRectangle)

Does the given rectangle cross the geographical date line

Signature:

(geoRectangle): boolean

Arguments:
  • v (geoRectangle) – arg0
Returns:

boolean

center(geoRectangle)

Center of the rectangle

Signature:

(geoRectangle): geoPoint

Arguments:
  • v (geoRectangle) – arg0
Returns:

geoPoint

height(geoRectangle)

Gets the height of the rectangle in degrees latitude.

Signature:

(geoRectangle): double

Arguments:
  • v (geoRectangle) – arg0
Returns:

double

width(geoRectangle)

Gets the width of the rectangle in degrees longitude.

Signature:

(geoRectangle): double

Arguments:
  • v (geoRectangle) – arg0
Returns:

double

geoRectangle(geoPoint, geoPoint)

Creates a Geo Rectangle by specifying two opposite corners

Signature:

(geoPoint, geoPoint): geoRectangle

Arguments:
  • lowerLeft (geoPoint) – arg0
  • upperRight (geoPoint) – arg1
Returns:

geoRectangle

geoRectangle(double, double, double, double)

Creates a Geo Rectangle by specifying all four coordiantes

Signature:

(double, double, double, double): geoRectangle

Arguments:
  • longMin (double) – arg0
  • latMin (double) – arg1
  • longMax (double) – arg2
  • latMax (double) – arg3
Returns:

geoRectangle

geoRectangle(string)

Creates a Geo Rectangle by passing a string like [28.898648N 77.037692W 38.898648N 67.037692W]

Signature:

(string): geoRectangle

Arguments:
  • str (string) – arg0
Returns:

geoRectangle

search(string)

A search function.

Signature:

(string): boolean

Repositories:

[ssr]

Arguments:
  • pattern (string) – arg0
Returns:

boolean

domain(email)

Gets the domain name..

Signature:

(email): string

Arguments:
  • v (email) – arg0
Returns:

string

email(string)

Constructs a email object.

Signature:

(string): email

Arguments:
  • txt (string) – arg0
Returns:

email

hasTag(tags, string)

True if the tags contain the passed value.

Signature:

(tags, string): boolean

Arguments:
  • nv (tags) – arg0
  • value (string) – arg1
Returns:

boolean

notTagged(tags)

True if the tagged values exists.

Signature:

(tags): boolean

Arguments:
  • nv (tags) – arg0
Returns:

boolean

isTagged(tags)

True if the tagged values exists.

Signature:

(tags): boolean

Arguments:
  • nv (tags) – arg0
Returns:

boolean

isNull(tags)

True if the value is null.

Signature:

(tags): boolean

Arguments:
  • nv (tags) – arg0
Returns:

boolean

Avg(double)

Calculates the average (arithmetic mean)

Signature:

(double): double

Arguments:
  • value (double) – value
Returns:

double

sum(byte)

Return the sum of the values seen

Signature:

(byte): long

Arguments:
  • value (byte) – value
Returns:

long

sum(short)

Return the sum of the values seen

Signature:

(short): long

Arguments:
  • value (short) – value
Returns:

long

sum(int)

Return the sum of the values seen

Signature:

(int): long

Arguments:
  • value (int) – value
Returns:

long

sum(long)

Return the sum of the values seen

Signature:

(long): long

Arguments:
  • value (long) – value
Returns:

long

sum(double)

Return the sum of the values seen

Signature:

(double): double

Arguments:
  • value (byte) – value
Returns:

double

Count()

Increments a counter each time a new payload is seen.

The result should be aliased (given a name) in the query:

from /streams/demo/infrastructure/cpu
select count() as c


 :signature: ``(): long``



 :returns: ``long``
Counter(string)

Counts the number of occurrences for each value of an argument.

Returns an array where each entry contains the value and the number of occurrences. Use CountDistinct if you just want the number of individual values (the number of buckets).

Functions in the same way as collections.Counter in Python or SELECT COUNT(grade) FROM table GROUP BY grade in SQL.

signature:(string): { entries: [{ value: string, count: long }] }
arg string value:
 value
returns:{ entries: [{ value: string, count: long }] }
CountDistinct(string)

Counts the number of unique values seen for the argument.

The result should be aliased (given a name) in the query:

from /streams/demo/infrastructure/cpu
select CountDistinct(host) as c

This is the equivalent operation to a SELECT COUNT(DISTINCT host) AS c in SQL.

signature:(string): int
arg string value:
 value
returns:int
min(byte)

Return the minimum value seen

Signature:

(byte): byte

Arguments:
  • value (byte) – value
Returns:

byte

min(short)

Return the minimum value seen

Signature:

(short): short

Arguments:
  • value (short) – value
Returns:

short

min(int)

Return the minimum value seen

Signature:

(int): int

Arguments:
  • value (int) – value
Returns:

int

min(long)

Return the minimum value seen

Signature:

(long): long

Arguments:
  • value (long) – value
Returns:

long

min(double)

Return the minimum value seen

Signature:

(double): double

Arguments:
  • value (double) – value
Returns:

double

min(datetime)

Return the minimum value seen

Signature:

(datetime): datetime

Arguments:
  • value (datetime) – value
Returns:

datetime

min(date)

Return the minimum value seen

Signature:

(date): date

Arguments:
  • value (date) – value
Returns:

date

min(time)

Return the minimum value seen

Signature:

(time): time

Arguments:
  • value (time) – value
Returns:

time

max(byte)

Return the maximum value seen

Signature:

(byte): byte

Arguments:
  • value (byte) – value
Returns:

byte

max(short)

Return the maximum value seen

Signature:

(short): short

Arguments:
  • value (short) – value
Returns:

short

max(int)

Return the maximum value seen

Signature:

(int): int

Arguments:
  • value (int) – value
Returns:

int

max(long)

Return the maximum value seen

Signature:

(long): long

Arguments:
  • value (long) – value
Returns:

long

max(double)

Return the maximum value seen

Signature:

(double): double

Arguments:
  • value (double) – value
Returns:

double

max(datetime)

Return the maximum value seen

Signature:

(datetime): datetime

Arguments:
  • value (datetime) – value
Returns:

datetime

max(date)

Return the maximum value seen

Signature:

(date): date

Arguments:
  • value (date) – value
Returns:

date

max(time)

Return the maximum value seen

Signature:

(time): time

Arguments:
  • value (time) – value
Returns:

time

Univar(double)

Calculate descriptive statistics against the given argument.

mean
The arithmetic mean of the values (as would be returned from the Avg function)
variance
The variance of the values. Smaller variances indicate the values are close to the mean, with larger variances indicating a greater range.
stDev
The standard deviation of the values. Shows the same information as the variance but expressed in the same units as the values themselves.
skew
How symmetrical is the distribution of values around the mean. A positive result indicates a skew above the mean, negative above.
kurtosis
How “peaky” is the distribution of values. A positive result indicates a tall peak and small tails. A negative result indicates a flatter distribution.
signature:(double): { mean: double, stDev: double, variance: double, skew: double, kurtosis: double, sum: double }
arg double value:
 value
returns:{ mean: double, stDev: double, variance: double, skew: double, kurtosis: double, sum: double }
Bivar(double, double)

Calculates statistics describing the correlation between the two arguments.

This function will be useful if is a linear correlation between the arguments. Also returns the univariate statistics for each argument (mean, variance).

covarXY

The covariance, indicating how the arguments change together. A positive number indicates the arguments show similar behaviour, a negative number the opposite.

slope(YX/XY)/intercept(YX/XY)

The properties of the regression lines between the two arguments. Calculated for both the relationship between the y parameter and the x parameter.

pearsonsR

The Pearson product-moment correlation coefficient indicating the strength of the linear correlation. Values range from -1 (total negative correlation), 0 (no correlation) to +1 (total positive correlation).

determinant

The determinant of the covariance matrix of the two parameters. The magnitude indicates how much the arguments are correlated in either direction (XY or XX).

signature:(double, double): { n: int, meanX: double, meanY: double, determinant: double, varX: double, varY: double, covarXY: double, slopeYX: double, interceptYX: double, slopeXY: double, interceptXY: double, pearsonsR: double, varianceFlag: int }
arg double x:x
arg double y:y
returns:{ n: int, meanX: double, meanY: double, determinant: double, varX: double, varY: double, covarXY: double, slopeYX: double, interceptYX: double, slopeXY: double, interceptXY: double, pearsonsR: double, varianceFlag: int }
Erfc(double)

Complementary Error function of the specified value

Signature:

(double): double

Arguments:
  • value (double) – arg0
Returns:

double

Erf(double)

Error function of the specified value

Signature:

(double): double

Arguments:
  • x (double) – arg0
Returns:

double

Last(datetime)

Returns the last value seen, discarding all others

Signature:

(datetime): datetime

Arguments:
  • value (datetime) – value
Returns:

datetime

Last(date)

Returns the last value seen, discarding all others

Signature:

(date): date

Arguments:
  • value (date) – value
Returns:

date

Last(double)

Returns the last value seen, discarding all others

Signature:

(double): double

Arguments:
  • value (double) – value
Returns:

double

Last(int)

Returns the last value seen, discarding all others

Signature:

(int): int

Arguments:
  • value (int) – value
Returns:

int

Last(long)

Returns the last value seen, discarding all others

Signature:

(long): long

Arguments:
  • value (long) – value
Returns:

long

Last(string)

Returns the last value seen, discarding all others

Signature:

(string): string

Arguments:
  • value (string) – value
Returns:

string

First(datetime)

Returns the first value seen, discarding all others

Signature:

(datetime): datetime

Arguments:
  • value (datetime) – value
Returns:

datetime

First(date)

Returns the first value seen, discarding all others

Signature:

(date): date

Arguments:
  • value (date) – value
Returns:

date

First(double)

Returns the first value seen, discarding all others

Signature:

(double): double

Arguments:
  • value (double) – value
Returns:

double

First(int)

Returns the first value seen, discarding all others

Signature:

(int): int

Arguments:
  • value (int) – value
Returns:

int

First(long)

Returns the first value seen, discarding all others

Signature:

(long): long

Arguments:
  • value (long) – value
Returns:

long

First(string)

Returns the first value seen, discarding all others

Signature:

(string): string

Arguments:
  • value (string) – value
Returns:

string

histogram(maxBins: int)(double)

Construct a histogram of the arguments, dynamically creating and adjusting the size and number of buckets based on the incoming data.

  • range: an array containing the minimum and maximum values seen
  • bins: the buckets themselves, containing the anchor value (the start of the bucket) and the number of values

maxBins must be specified, limiting the number of buckets. Somewhere between 80 and 200 is a good place to start.

signature:(maxBins: int)(double): { range: [double], bins: [{ anchor: double, count: long }] }
initArg int maxBins:
 Maximum number of bins to generate. For unknown distributions 80 to 200 works best.
arg double value:
 Numerical value
returns:{ range: [double], bins: [{ anchor: double, count: long }] }
quantiles(maxBins: int, quantiles: double)(double)

Calculate the values for custom quantiles against the argument provided.

The quantiles are specified as decimals between 0 and 1. For example, the following calculates the 50th, 75th and 99th percentiles:

from /streams/demo/infrastructure/cpu
group by sampleTime window of 3 seconds every 1 second
  select quantiles(maxBins = 200, quantiles = [0.5, 0.75, 0.99]) (user) as quantiles

The result is returned as an array where each element is the value for the quantile given in the initialiser.

The algorithm is implemented internally in terms of the histogram function and as such requires the same maxBins setting. Values of 80 to 200 are good starting points.

signature:(maxBins: int, quantiles: double)(double): [double]
initArg int maxBins:
 Maximum number of bins to generate. For unknown distributions 80 to 200 works best.
initArg double quantiles:
 Quantiles to calculate. For example: [0.5, 0.99] gets you the 50th and 99th percentile
arg double value:
 Numerical value
returns:[double]
topk(k: int)(string, int)

Computes heavy hitters over a stream

  • k: Number of heavy hitters to report
  • field: List of fields to consider
  • count: Increment
signature:(k: int)(string, int): { values: [{ item: string, lowerBound: long, upperBound: long, pct: double, lastValue: long }] }
initArg int k:k
arg string field:
 Field to identify heavy hitters
arg int count:Positive increment
returns:{ values: [{ item: string, lowerBound: long, upperBound: long, pct: double, lastValue: long }] }
EMA(tau: double)(datetime, double)

Exponential Moving Average with next point interpolation

Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMicroTickFrequency(tau: double)(datetime)

Average tick arrival over the given period

Signature:

(tau: double)(datetime): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
Returns:

double

iMicroVolatility(tau: double)(datetime, double)

Microscopic Volatility is computed as the norm of the microscopic derivative of the signal

Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovAverage(tau: double)(datetime, double)

Moving Average for irregular time series

Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovDerivative(tau: double, exponent: double?)(datetime, double)

Moving Derivative for irregular time series

Signature:

(tau: double, exponent: double?)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • exponent (double) – Use 1.0 for the usual derivative, 0.0 for a differential operator and 0.5 for a stochastic diffusion process
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovDifferential(tau: double)(datetime, double)

Moving Differential for irregular time series

Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovKurtosis(tau: double, stdTau: double)(datetime, double)

Moving Kurtosis for irregular time series

Signature:

(tau: double, stdTau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • stdTau (double) – Window Length in seconds for z-Normalization (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovNorm(tau: double, exponent: double?)(datetime, double)

Moving Norm for irregular time series

Signature:

(tau: double, exponent: double?)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • exponent (double) – p-moment. Usually 2.0 is taken; lower values produce a more robust estimate
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovOscillator(tau: double)(datetime, double)

Moving Oscillator over an irregular time series

Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovSkewness(tau: double, stdTau: double)(datetime, double)

Moving Kurtosis for irregular time series

Signature:

(tau: double, stdTau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • stdTau (double) – Range of the z-standarized operator
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovStandardDeviation(tau: double, exponent: double?)(datetime, double)

Moving Standard Deviation for irregular time series

Signature:

(tau: double, exponent: double?)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • exponent (double) – p-moment. Usually 2.0 is taken; lower values produce a more robust estimate.
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovVariance(tau: double, exponent: double?)(datetime, double)

Moving Variance for irregular time series

Signature:

(tau: double, exponent: double?)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • exponent (double) – p-moment. Usually 2.0 is taken; lower values produce a more robust estimate.
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovVolatility(tau: double)(datetime, double)

Moving Volatility for irregular time series

Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iMovZ(tau: double)(datetime, double)
Signature:

(tau: double)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

iEMA(tau: double, n: int)(datetime, double)

Iterated (Recursive) EMA Operator

Signature:

(tau: double, n: int)(datetime, double): double

Init Arguments:
  • tau (double) – Window Length in seconds (up to nanosecond resolution)
  • n (int) – Level of recursion
Arguments:
  • timestamp (datetime) – Timestamp associated with the point being processed
  • value (double) – Value of the time series at the given timestamp
Returns:

double

anomaly(lagWindow: int, leadWindow: int, featureSize: int, level: int?, wordLen: int?)(double)

Identify anomalies in a time series: areas that do not conform to previous patterns.

The method is fully described in Assumption-Free Anomaly Detection in Time Series.

Usage involves a training phase while the algorithm builds up a picture of “normality”. During this time the isTraining flag in the results is set to true.

Once trained, the algorithm will emit both the original values (point) and a signal, indicating how far from “normality” the time series is currently.

The algorithm will continue to adapt to the incoming data. Regular anomalous patterns will be absorbed into the definition of “normality” and no longer cause the signal to rise.

The user must specify three parameters:

featureSize

The number of values within which an anomalous event could happen. To determine this, think about the update/refresh rate of your input and experiment with different numbers based on that. For instance, when using this algorithm against ECG data, the featureSize would be the length of a heartbeat.

lagWindow

How much past input is remembered and used to judge how far from “normality” the time series is right now. Rough guidance is three times the featureSize.

leadWindow

How much current input is used and compared against “normality”. Rough guidance is half the lagWindow.

See the following <https://www.quora.com/MLconf-2015-Seattle/How-does-the-symbolic-aggregate-approximation-SAX-technique-work> for a description of how the underlying indexing mechanism works.

signature:(lagWindow: int, leadWindow: int, featureSize: int, level: int?, wordLen: int?)(double): { isTraining: boolean, point: double, signal: double }
initArg int lagWindow:
 How much memory of the past you use to judge the future. Lag window size is how much memory the algorithm should keep to compare to the data in the lead window
initArg int leadWindow:
 Lead window size is how far to look ahead. A reasonable value would be 2 or 3 times the length of feature window size
initArg int featureSize:
 Feature window size should be about the size at which events happen
initArg int level:
 Level of recursion associated with bitmap representations (see paper)
initArg int wordLen:
 How many “characters” the SAX word should have
arg double value:
 The values of the time series
returns:{ isTraining: boolean, point: double, signal: double }