Derived metric calculates a value F(m1, m2, ${xyz},...), where
F - is an arithmetical expression.
m1,m2,... - is a reference to exisiting metric in loaded cube
${xyz} - a value of the variable "xyz".
Supported operations:
+, /, - , *, ^, |?| and (?)
Supported functions:
sin,cos,tan,asin,acos,atan,sqrt,log,exp,random,abs,pos,neg,sgn,min(a,b), max(a,b)
Supported inplace function definition:
{ [statements] return [expression];}
As [statement] are supported:
1. if ([condition]) { [statements] } or
2. if ([condition]) { [stetements] } else { [statements]} - define a conditional execution
3. while (condition) {[statements] } - defines a loop, which is executed as long the conditioin is true. (max 1000000000 times)
4. ${xyz} = expression - assignment of the value of an expression to the variable "xyz"
[expression] - is either an arithmetical expression or a value of a variable ${xyz}.
As condition supported:
boolean operations with "and", "or", "not", "xor", ">", "<", ">=", "<=", "==" , "!="
Metric reference syntax:
metric::[unique name of metric X]()br
takes the value of metric "X", calculated with the same arguments, with which the derivated metric is going to be calculated
metric::[unique name of metric X](x)
takes the value of metric "X", calculated with the same arguments, with which the derivated metric is going to be calculated and x denotes a calculation modification along calltree;
metric::[unique name of metric X](x,y)
takes the value of metric "X", calculated with the same arguments, with which the derivated metric is going to be calculated, x denotes a calculation modification along calltree and y - along system tree
Calculation modificators:
"*" -doesn't modify calculation
"i" - enforces inclusive calculation and
"e" - enforces calculation of an exclusive value.
Examples:
metric::time(i)
has always (independen, if callpatgh is expanded or collapsed) an inclusive value of metric "time"
metric::time(i)/metric::visits(*)
calculates inclusive time per visits
metric::numberofbytes()/metric::numberofallocations(*)
calculates average value of a memory allocation
sin(23.4)*23^4-sqrt(3)/34
shows a constant value
{ ${a}=0; while (${a} < 100) { ${b}=${b}+metric::visits(); ${a}=${a}+1;}; return ${b}; }
shows a 100 times a metric "visits" value, calculated using inplace function definition.
Unique name of a metric you can get in the item "Full info" in the metric context menu