Page tree

SAYMON документация

Skip to end of metadata
Go to start of metadata

To create more complex conditions based on mathematical operations, it is possible to use the formula editor.

Formulas input

To use formulas it is essential to:

  1. Switch to the manual input mode .

  2. Enter the metric name in the Data source field or select it in the filtered list of options. The name of each metric must be written in braces as follow: {{metric_name}}.



  3. Input the formula using mathematical symbols, constants, and braces.

    For example, the difference between the maximal round-trip time and of minimal round-trip time:
    {{roundTripMaximum}} - {{roundTripMinimal}}.

    The result of calculations will automatically be displayed over the entered mathematical operation.


Available operations, operators and functions

Operations 

OperationDescription
!Factorial
^Exponentiation
*Multiplication
/Division
%Remainder of division
+Addition
-Substraction
||Concatenation
==Equal
!=Not equal
>=Greater or equal
<=Less or equal
>Greater
<Less
andLogical AND
orLogical OR
notLogical NOT
x ? y : zTernary conditional (if x then y else z)

Operators 

OperatorDescription
x!Factorial (x * (x-1) * (x-2) * … * 2 * 1). gamma(x + 1) for non-integers
abs xThe absolute value of x
ceil xRound to the next integer
floor xRound to the previous integer
length xString length of x
round xRound to the nearest integer
sqrt xSquare root of x
trunc xRemove the fractional part of x
exp xe^x (exponential/antilogarithm function with base e)
ln x or log xNatural logarithm of x
log10 xBase-10 logarithm of x
acos xArc cosine of x (in radians)
acosh xHyperbolic arc cosine of x (in radians)
asin xArc sine of x (in radians)
asinh xHyperbolic arc sine of x (in radians)
atan xArc tangent of x (in radians)
atanh xHyperbolic arc tangent of x (in radians)
cos xCosine of x (in radians)
cosh xHyperbolic cosine of x (in radians)
sin xSine of x (in radians)
sinh xHyperbolic sine of x (x is in radians)
tan xTangent of x (in radians)
tanh xHyperbolic tangent of x (x is in radians)

Functions 

Function        Description
random(n)Get a random number in the range [0, n). If n is equal to zero, or not provided, it defaults to 1.
min(a,b,…)Get the smallest (minimum) number in the list.
max(a,b,…)Get the largest (maximum) number in the list.
hypot(a,b) or
pyt(a, b)
Hypotenuse, i.e. the square root of the sum of squares of its arguments (sqrt(a^2+b^2)).
pow(x, y)Equivalent of exponentiation x^y.
atan2(y, x)Arc tangent of x/y. i.e. the angle between (0, 0) and (x, y) in radians.
if(x, y, z)Equivalent of the ternary conditional (if x then y else z).
  • No labels