public Object eval(List<Object> metrics) {
      SimpleEvaluationContext context = SimpleEvaluationContext.forReadWriteDataBinding().build();
      for(int i = 0; i < metrics.size(); i++) {
        context.setVariable("var" + i, metrics.get(i));
      }
      return new SpelExpressionParser()
        .parseExpression(value.replaceAll("(\\{(\\d+)\\})", "#var$2"))
        .getValue(context);
    }
Evaluate an expression like "{0}/({0} + {1}) * 100.0" where each positional argument represent a metrics value.
The value is converted to SpEL syntax:
 #var0/(#var0 + #var1) * 100.0
then it is evaluated in the context of the metrics parameters.
ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java