NamedRewrite

com.netflix.atlas.core.model.MathExpr.NamedRewrite
case class NamedRewrite(name: String, displayExpr: Expr, evalExpr: TimeSeriesExpr, context: Context, groupByRewrite: Option[(Expr, List[String]) => Expr]) extends TimeSeriesExpr

Named rewrites are used to keep track of the user intent for operations and macros that are defined in terms of other basic operations. For example, :avg is not available as a basic aggregate type, it is a rewrite to query,:sum,query,:count,:div. However, for the user it is better if we can show query,:avg when dumping the expression as a string.

Value parameters

context

Evaluation context for the initial creation time. This context is used to re-evaluate the rewrite using the original context if the overall expression is rewritten (Expr.rewrite()) later.

displayExpr

Expression that is displayed to the user when creating the expression string.

evalExpr

Expression that is evaluated.

name

Name of the operation, e.g., avg.

Attributes

Graph
Supertypes
trait Serializable
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def dataExprs: List[DataExpr]

The underlying data expressions that supply input for the evaluation. These are used to fetch data from the data stores. There may be some expressions types that generate data and will have an empty set. Examples are constants, random, or time.

The underlying data expressions that supply input for the evaluation. These are used to fetch data from the data stores. There may be some expressions types that generate data and will have an empty set. Examples are constants, random, or time.

Attributes

def eval(context: EvalContext, data: Map[DataExpr, List[TimeSeries]]): ResultSet
def finalGrouping: List[String]

Returns the final grouping for the expression. For non-grouped expressions this will be an empty list. If a multi-level group by is used, then this will return the grouping of the final result and ignore any intermediate groupings.

Returns the final grouping for the expression. For non-grouped expressions this will be an empty list. If a multi-level group by is used, then this will return the grouping of the final result and ignore any intermediate groupings.

Attributes

def groupBy(keys: List[String]): NamedRewrite
def groupByKey(tags: Map[String, String]): Option[String]

Returns the grouping key generated for a given tag map. All keys for the group by must be present in the map.

Returns the grouping key generated for a given tag map. All keys for the group by must be present in the map.

Attributes

def isGrouped: Boolean

Returns true if the result is grouped. See GroupBy operators.

Returns true if the result is grouped. See GroupBy operators.

Attributes

override def rewrite(f: PartialFunction[Expr, Expr]): Expr

Rewrite the expression using the specified function. The default implementation will try to recursively apply the rewrite to case classes.

Rewrite the expression using the specified function. The default implementation will try to recursively apply the rewrite to case classes.

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
override def withOffset(d: Duration): TimeSeriesExpr

Apply a time shift to all underlying data expressions.

Apply a time shift to all underlying data expressions.

Attributes

Definition Classes

Inherited methods

def eval(context: EvalContext, data: List[TimeSeries]): ResultSet

Attributes

Inherited from:
TimeSeriesExpr
def exprString: String

Returns a string that can be executed with the stack interpreter to create this expression.

Returns a string that can be executed with the stack interpreter to create this expression.

Attributes

Inherited from:
Expr
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product