Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval: remove unused method in ExprInterpreter #1622

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading