Skip to content

Commit

Permalink
eval: remove unused method in ExprInterpreter (Netflix#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
brharrington authored and manolama committed May 22, 2024
1 parent 7fa216e commit da05775
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@
package com.netflix.atlas.eval.stream

import org.apache.pekko.http.scaladsl.model.Uri
import com.netflix.atlas.core.model.CustomVocabulary
import com.netflix.atlas.core.model.DataExpr
import com.netflix.atlas.core.model.Expr
import com.netflix.atlas.core.model.FilterExpr
import com.netflix.atlas.core.model.ModelExtractors
import com.netflix.atlas.core.model.StatefulExpr
import com.netflix.atlas.core.model.StyleExpr
import com.netflix.atlas.core.stacklang.Interpreter
import com.netflix.atlas.eval.graph.GraphConfig
import com.netflix.atlas.eval.graph.Grapher
import com.netflix.atlas.eval.graph.SimpleLegends
import com.netflix.atlas.eval.stream.Evaluator.DataSource
import com.netflix.atlas.eval.stream.Evaluator.DataSources
import com.netflix.atlas.eval.util.HostRewriter
Expand All @@ -37,26 +32,12 @@ import scala.util.Success

private[stream] class ExprInterpreter(config: Config) {

private val interpreter = Interpreter(new CustomVocabulary(config).allWords)

private val grapher = Grapher(config)

private val hostRewriter = new HostRewriter(config.getConfig("atlas.eval.host-rewrite"))

private val maxStep = config.getDuration("atlas.eval.stream.limits.max-step")

// Use simple legends for expressions
private val simpleLegendsEnabled: Boolean =
config.getBoolean("atlas.eval.graph.simple-legends-enabled")

def eval(expr: String): List[StyleExpr] = {
val exprs = interpreter.execute(expr).stack.map {
case ModelExtractors.PresentationType(t) => t
case v => throw new MatchError(v)
}
if (simpleLegendsEnabled) SimpleLegends.generate(exprs) else exprs
}

def eval(uri: Uri): GraphConfig = {
val graphCfg = grapher.toGraphConfig(uri)

Expand Down

0 comments on commit da05775

Please sign in to comment.