Skip to content

Commit

Permalink
Remove holt_winters_alias
Browse files Browse the repository at this point in the history
Signed-off-by: Arve Knudsen <[email protected]>
  • Loading branch information
aknuds1 committed Nov 6, 2024
1 parent 60b7c44 commit a4011f6
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 82 deletions.
86 changes: 42 additions & 44 deletions promql/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1668,50 +1668,48 @@ var FunctionCalls = map[string]FunctionCall{
"histogram_stddev": funcHistogramStdDev,
"histogram_stdvar": funcHistogramStdVar,
"double_exponential_smoothing": funcDoubleExponentialSmoothing,
// Keep an alias for Mimir users using holt_winters.
"holt_winters": funcDoubleExponentialSmoothing,
"hour": funcHour,
"idelta": funcIdelta,
"increase": funcIncrease,
"info": nil,
"irate": funcIrate,
"label_replace": nil, // evalLabelReplace not called via this map.
"label_join": nil, // evalLabelJoin not called via this map.
"ln": funcLn,
"log10": funcLog10,
"log2": funcLog2,
"last_over_time": funcLastOverTime,
"mad_over_time": funcMadOverTime,
"max_over_time": funcMaxOverTime,
"min_over_time": funcMinOverTime,
"minute": funcMinute,
"month": funcMonth,
"pi": funcPi,
"predict_linear": funcPredictLinear,
"present_over_time": funcPresentOverTime,
"quantile_over_time": funcQuantileOverTime,
"rad": funcRad,
"rate": funcRate,
"resets": funcResets,
"round": funcRound,
"scalar": funcScalar,
"sgn": funcSgn,
"sin": funcSin,
"sinh": funcSinh,
"sort": funcSort,
"sort_desc": funcSortDesc,
"sort_by_label": funcSortByLabel,
"sort_by_label_desc": funcSortByLabelDesc,
"sqrt": funcSqrt,
"stddev_over_time": funcStddevOverTime,
"stdvar_over_time": funcStdvarOverTime,
"sum_over_time": funcSumOverTime,
"tan": funcTan,
"tanh": funcTanh,
"time": funcTime,
"timestamp": funcTimestamp,
"vector": funcVector,
"year": funcYear,
"hour": funcHour,
"idelta": funcIdelta,
"increase": funcIncrease,
"info": nil,
"irate": funcIrate,
"label_replace": nil, // evalLabelReplace not called via this map.
"label_join": nil, // evalLabelJoin not called via this map.
"ln": funcLn,
"log10": funcLog10,
"log2": funcLog2,
"last_over_time": funcLastOverTime,
"mad_over_time": funcMadOverTime,
"max_over_time": funcMaxOverTime,
"min_over_time": funcMinOverTime,
"minute": funcMinute,
"month": funcMonth,
"pi": funcPi,
"predict_linear": funcPredictLinear,
"present_over_time": funcPresentOverTime,
"quantile_over_time": funcQuantileOverTime,
"rad": funcRad,
"rate": funcRate,
"resets": funcResets,
"round": funcRound,
"scalar": funcScalar,
"sgn": funcSgn,
"sin": funcSin,
"sinh": funcSinh,
"sort": funcSort,
"sort_desc": funcSortDesc,
"sort_by_label": funcSortByLabel,
"sort_by_label_desc": funcSortByLabelDesc,
"sqrt": funcSqrt,
"stddev_over_time": funcStddevOverTime,
"stdvar_over_time": funcStdvarOverTime,
"sum_over_time": funcSumOverTime,
"tan": funcTan,
"tanh": funcTanh,
"time": funcTime,
"timestamp": funcTimestamp,
"vector": funcVector,
"year": funcYear,
}

// AtModifierUnsafeFunctions are the functions whose result
Expand Down
7 changes: 0 additions & 7 deletions promql/parser/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,6 @@ var Functions = map[string]*Function{
ReturnType: ValueTypeVector,
Experimental: true,
},
// Keep an alias for Mimir users using holt_winters.
"holt_winters": {
Name: "holt_winters",
ArgTypes: []ValueType{ValueTypeMatrix, ValueTypeScalar, ValueTypeScalar},
ReturnType: ValueTypeVector,
Experimental: true,
},
"hour": {
Name: "hour",
ArgTypes: []ValueType{ValueTypeVector},
Expand Down
3 changes: 0 additions & 3 deletions web/ui/mantine-ui/src/promql/functionMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export const functionArgNames: Record<string, string[]> = {
// floor: [],
histogram_quantile: ['target quantile', 'histogram'],
double_exponential_smoothing: ['input series', 'smoothing factor', 'trend factor'],
// double_exponential_smoothing alias.
holt_winters: ['input series', 'smoothing factor', 'trend factor'],
hour: ['timestamp (default = vector(time()))'],
// idelta: [],
// increase: [],
Expand Down Expand Up @@ -71,7 +69,6 @@ export const functionDescriptions: Record<string, string> = {
floor: 'round down values of input series to nearest integer',
histogram_quantile: 'calculate quantiles from histogram buckets',
double_exponential_smoothing: 'calculate smoothed value of input series',
holt_winters: 'calculate smoothed value of input series',
hour: 'return the hour of the day for provided timestamps',
idelta: 'calculate the difference between the last two samples of a range vector (for counters)',
increase: 'calculate the increase in value over a range of time (for counters)',
Expand Down
7 changes: 0 additions & 7 deletions web/ui/mantine-ui/src/promql/functionSignatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ export const functionSignatures: Record<string, Func> = {
variadic: 0,
returnType: valueType.vector,
},
// double_exponential_smoothing alias.
holt_winters: {
name: 'holt_winters',
argTypes: [valueType.matrix, valueType.scalar, valueType.scalar],
variadic: 0,
returnType: valueType.vector,
},
hour: { name: 'hour', argTypes: [valueType.vector], variadic: 1, returnType: valueType.vector },
idelta: { name: 'idelta', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },
increase: { name: 'increase', argTypes: [valueType.matrix], variadic: 0, returnType: valueType.vector },
Expand Down
7 changes: 0 additions & 7 deletions web/ui/module/codemirror-promql/src/complete/promql.terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,6 @@ export const functionIdentifierTerms = [
info: 'Calculate smoothed value of input series',
type: 'function',
},
// double_exponential_smoothing alias.
{
label: 'holt_winters',
detail: 'function',
info: 'Calculate smoothed value of input series',
type: 'function',
},
{
label: 'hour',
detail: 'function',
Expand Down
9 changes: 0 additions & 9 deletions web/ui/module/codemirror-promql/src/types/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ import {
HistogramStdVar,
HistogramSum,
DoubleExponentialSmoothing,
// double_exponential_smoothing alias.
HoltWinters,
Hour,
Idelta,
Increase,
Expand Down Expand Up @@ -321,13 +319,6 @@ const promqlFunctions: { [key: number]: PromQLFunction } = {
variadic: 0,
returnType: ValueType.vector,
},
// double_exponential_smoothing alias.
[HoltWinters]: {
name: 'holt_winters',
argTypes: [ValueType.matrix, ValueType.scalar, ValueType.scalar],
variadic: 0,
returnType: ValueType.vector,
},
[Hour]: {
name: 'hour',
argTypes: [ValueType.vector],
Expand Down
2 changes: 1 addition & 1 deletion web/ui/module/lezer-promql/src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const promQLHighLight = styleTags({
NumberDurationLiteral: tags.number,
NumberDurationLiteralInDurationContext: tags.number,
Identifier: tags.variableName,
'Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp Floor HistogramAvg HistogramCount HistogramFraction HistogramQuantile HistogramSum DoubleExponentialSmoothing HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year':
'Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek DayOfYear Deg Delta Deriv Exp Floor HistogramAvg HistogramCount HistogramFraction HistogramQuantile HistogramSum DoubleExponentialSmoothing Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc SortByLabel SortByLabelDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year':
tags.function(tags.variableName),
'Avg Bottomk Count Count_values Group LimitK LimitRatio Max Min Quantile Stddev Stdvar Sum Topk': tags.operatorKeyword,
'By Without Bool On Ignoring GroupLeft GroupRight Offset Start End': tags.modifier,
Expand Down
4 changes: 0 additions & 4 deletions web/ui/module/lezer-promql/src/promql.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ FunctionIdentifier {
HistogramSum |
HistogramAvg |
DoubleExponentialSmoothing |
// DoubleExponentialSmoothing alias.
HoltWinters |
Hour |
Idelta |
Increase |
Expand Down Expand Up @@ -392,8 +390,6 @@ NumberDurationLiteralInDurationContext {
HistogramStdVar { condFn<"histogram_stdvar"> }
HistogramSum { condFn<"histogram_sum"> }
DoubleExponentialSmoothing { condFn<"double_exponential_smoothing"> }
// DoubleExponentialSmoothing alias.
HoltWinters { condFn<"holt_winters"> }
Hour { condFn<"hour"> }
Idelta { condFn<"idelta"> }
Increase { condFn<"increase"> }
Expand Down

0 comments on commit a4011f6

Please sign in to comment.