mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Add copyright notices to all remaining files.
This commit is contained in:
parent
d8c4f2c3c9
commit
16d9dcd6a8
|
@ -1,3 +1,16 @@
|
||||||
|
# Copyright 2013 Prometheus Team
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
all: parser.y.go lexer.l.go
|
all: parser.y.go lexer.l.go
|
||||||
|
|
||||||
parser.y.go: parser.y
|
parser.y.go: parser.y
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
/* Copyright 2013 Prometheus Team
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http: *www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License. */
|
||||||
|
|
||||||
%{
|
%{
|
||||||
package config
|
package config
|
||||||
%}
|
%}
|
||||||
|
|
|
@ -216,13 +216,13 @@ func yylex() int {
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
var S_GLOBAL yystartcondition = 1024
|
|
||||||
var S_JOB yystartcondition = 1026
|
|
||||||
var S_GLOBAL_LABELS yystartcondition = 1025
|
|
||||||
var S_TARGET_LABELS yystartcondition = 1028
|
|
||||||
var S_COMMENTS yystartcondition = 1029
|
|
||||||
var S_TARGETS yystartcondition = 1027
|
var S_TARGETS yystartcondition = 1027
|
||||||
var yystartconditionexclmap = map[yystartcondition]bool{S_GLOBAL: false, S_JOB: false, S_GLOBAL_LABELS: false, S_TARGET_LABELS: false, S_COMMENTS: true, S_TARGETS: false, }
|
var S_GLOBAL_LABELS yystartcondition = 1025
|
||||||
|
var S_JOB yystartcondition = 1026
|
||||||
|
var S_TARGET_LABELS yystartcondition = 1028
|
||||||
|
var S_GLOBAL yystartcondition = 1024
|
||||||
|
var S_COMMENTS yystartcondition = 1029
|
||||||
|
var yystartconditionexclmap = map[yystartcondition]bool{S_COMMENTS: true, S_TARGETS: false, S_GLOBAL_LABELS: false, S_JOB: false, S_TARGET_LABELS: false, S_GLOBAL: false, }
|
||||||
var yyrules []yyrule = []yyrule{{regexp.MustCompile("[^\\n]"), nil, []yystartcondition{}, false, func() (yyar yyactionreturn) {
|
var yyrules []yyrule = []yyrule{{regexp.MustCompile("[^\\n]"), nil, []yystartcondition{}, false, func() (yyar yyactionreturn) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
%{
|
%{
|
||||||
package config
|
package config
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
//line parser.y:2
|
//line parser.y:15
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import "github.com/prometheus/prometheus/model"
|
import "github.com/matttproud/prometheus/model"
|
||||||
|
|
||||||
//line parser.y:8
|
//line parser.y:21
|
||||||
type yySymType struct {
|
type yySymType struct {
|
||||||
yys int
|
yys int
|
||||||
num model.SampleValue
|
num model.SampleValue
|
||||||
|
@ -39,7 +39,7 @@ const yyEofCode = 1
|
||||||
const yyErrCode = 2
|
const yyErrCode = 2
|
||||||
const yyMaxDepth = 200
|
const yyMaxDepth = 200
|
||||||
|
|
||||||
//line parser.y:102
|
//line parser.y:115
|
||||||
|
|
||||||
|
|
||||||
//line yacctab:1
|
//line yacctab:1
|
||||||
|
@ -359,61 +359,61 @@ yydefault:
|
||||||
switch yynt {
|
switch yynt {
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
//line parser.y:32
|
//line parser.y:45
|
||||||
{ PopJob() }
|
{ PopJob() }
|
||||||
case 7:
|
case 7:
|
||||||
//line parser.y:40
|
//line parser.y:53
|
||||||
{ parsedConfig.Global.SetOption(yyS[yypt-2].str, yyS[yypt-0].str) }
|
{ parsedConfig.Global.SetOption(yyS[yypt-2].str, yyS[yypt-0].str) }
|
||||||
case 8:
|
case 8:
|
||||||
//line parser.y:42
|
//line parser.y:55
|
||||||
{ parsedConfig.Global.SetLabels(yyS[yypt-0].labelSet) }
|
{ parsedConfig.Global.SetLabels(yyS[yypt-0].labelSet) }
|
||||||
case 9:
|
case 9:
|
||||||
//line parser.y:44
|
//line parser.y:57
|
||||||
{ parsedConfig.Global.AddRuleFiles(yyS[yypt-0].stringSlice) }
|
{ parsedConfig.Global.AddRuleFiles(yyS[yypt-0].stringSlice) }
|
||||||
case 10:
|
case 10:
|
||||||
//line parser.y:48
|
//line parser.y:61
|
||||||
{ yyVAL.labelSet = yyS[yypt-1].labelSet }
|
{ yyVAL.labelSet = yyS[yypt-1].labelSet }
|
||||||
case 11:
|
case 11:
|
||||||
//line parser.y:50
|
//line parser.y:63
|
||||||
{ yyVAL.labelSet = model.LabelSet{} }
|
{ yyVAL.labelSet = model.LabelSet{} }
|
||||||
case 12:
|
case 12:
|
||||||
//line parser.y:54
|
//line parser.y:67
|
||||||
{ yyVAL.labelSet = yyS[yypt-0].labelSet }
|
{ yyVAL.labelSet = yyS[yypt-0].labelSet }
|
||||||
case 13:
|
case 13:
|
||||||
//line parser.y:56
|
//line parser.y:69
|
||||||
{ for k, v := range yyS[yypt-0].labelSet { yyVAL.labelSet[k] = v } }
|
{ for k, v := range yyS[yypt-0].labelSet { yyVAL.labelSet[k] = v } }
|
||||||
case 14:
|
case 14:
|
||||||
//line parser.y:60
|
//line parser.y:73
|
||||||
{ yyVAL.labelSet = model.LabelSet{ model.LabelName(yyS[yypt-2].str): model.LabelValue(yyS[yypt-0].str) } }
|
{ yyVAL.labelSet = model.LabelSet{ model.LabelName(yyS[yypt-2].str): model.LabelValue(yyS[yypt-0].str) } }
|
||||||
case 15:
|
case 15:
|
||||||
//line parser.y:64
|
//line parser.y:77
|
||||||
{ yyVAL.stringSlice = yyS[yypt-0].stringSlice }
|
{ yyVAL.stringSlice = yyS[yypt-0].stringSlice }
|
||||||
case 18:
|
case 18:
|
||||||
//line parser.y:72
|
//line parser.y:85
|
||||||
{ PushJobOption(yyS[yypt-2].str, yyS[yypt-0].str) }
|
{ PushJobOption(yyS[yypt-2].str, yyS[yypt-0].str) }
|
||||||
case 19:
|
case 19:
|
||||||
//line parser.y:74
|
//line parser.y:87
|
||||||
{ PushJobTargets() }
|
{ PushJobTargets() }
|
||||||
case 22:
|
case 22:
|
||||||
//line parser.y:82
|
//line parser.y:95
|
||||||
{ PushTargetEndpoints(yyS[yypt-0].stringSlice) }
|
{ PushTargetEndpoints(yyS[yypt-0].stringSlice) }
|
||||||
case 23:
|
case 23:
|
||||||
//line parser.y:84
|
//line parser.y:97
|
||||||
{ PushTargetLabels(yyS[yypt-0].labelSet) }
|
{ PushTargetLabels(yyS[yypt-0].labelSet) }
|
||||||
case 24:
|
case 24:
|
||||||
//line parser.y:88
|
//line parser.y:101
|
||||||
{ yyVAL.stringSlice = yyS[yypt-0].stringSlice }
|
{ yyVAL.stringSlice = yyS[yypt-0].stringSlice }
|
||||||
case 25:
|
case 25:
|
||||||
//line parser.y:92
|
//line parser.y:105
|
||||||
{ yyVAL.stringSlice = yyS[yypt-1].stringSlice }
|
{ yyVAL.stringSlice = yyS[yypt-1].stringSlice }
|
||||||
case 26:
|
case 26:
|
||||||
//line parser.y:94
|
//line parser.y:107
|
||||||
{ yyVAL.stringSlice = []string{} }
|
{ yyVAL.stringSlice = []string{} }
|
||||||
case 27:
|
case 27:
|
||||||
//line parser.y:98
|
//line parser.y:111
|
||||||
{ yyVAL.stringSlice = []string{yyS[yypt-0].str} }
|
{ yyVAL.stringSlice = []string{yyS[yypt-0].str} }
|
||||||
case 28:
|
case 28:
|
||||||
//line parser.y:100
|
//line parser.y:113
|
||||||
{ yyVAL.stringSlice = append(yyVAL.stringSlice, yyS[yypt-0].str) }
|
{ yyVAL.stringSlice = append(yyVAL.stringSlice, yyS[yypt-0].str) }
|
||||||
}
|
}
|
||||||
goto yystack /* stack new state and value */
|
goto yystack /* stack new state and value */
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
# Copyright 2013 Prometheus Team
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
all: parser.y.go lexer.l.go
|
all: parser.y.go lexer.l.go
|
||||||
|
|
||||||
parser.y.go: parser.y
|
parser.y.go: parser.y
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
/* Copyright 2013 Prometheus Team
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http: *www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License. */
|
||||||
|
|
||||||
%{
|
%{
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
)
|
)
|
||||||
import (
|
import (
|
||||||
"github.com/prometheus/prometheus/model"
|
"github.com/matttproud/prometheus/model"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
%{
|
%{
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
|
||||||
//line parser.y:2
|
//line parser.y:15
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import "github.com/prometheus/prometheus/model"
|
import "github.com/matttproud/prometheus/model"
|
||||||
import "github.com/prometheus/prometheus/rules/ast"
|
import "github.com/matttproud/prometheus/rules/ast"
|
||||||
|
|
||||||
//line parser.y:9
|
//line parser.y:22
|
||||||
type yySymType struct {
|
type yySymType struct {
|
||||||
yys int
|
yys int
|
||||||
num model.SampleValue
|
num model.SampleValue
|
||||||
|
@ -52,7 +52,7 @@ const yyEofCode = 1
|
||||||
const yyErrCode = 2
|
const yyErrCode = 2
|
||||||
const yyMaxDepth = 200
|
const yyMaxDepth = 200
|
||||||
|
|
||||||
//line parser.y:162
|
//line parser.y:175
|
||||||
|
|
||||||
|
|
||||||
//line yacctab:1
|
//line yacctab:1
|
||||||
|
@ -381,120 +381,120 @@ yydefault:
|
||||||
switch yynt {
|
switch yynt {
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
//line parser.y:52
|
//line parser.y:65
|
||||||
{ yylex.(*RulesLexer).parsedExpr = yyS[yypt-0].ruleNode }
|
{ yylex.(*RulesLexer).parsedExpr = yyS[yypt-0].ruleNode }
|
||||||
case 6:
|
case 6:
|
||||||
//line parser.y:56
|
//line parser.y:69
|
||||||
{
|
{
|
||||||
rule, err := CreateRule(yyS[yypt-3].str, yyS[yypt-2].labelSet, yyS[yypt-0].ruleNode, yyS[yypt-4].boolean)
|
rule, err := CreateRule(yyS[yypt-3].str, yyS[yypt-2].labelSet, yyS[yypt-0].ruleNode, yyS[yypt-4].boolean)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
yylex.(*RulesLexer).parsedRules = append(yylex.(*RulesLexer).parsedRules, rule)
|
yylex.(*RulesLexer).parsedRules = append(yylex.(*RulesLexer).parsedRules, rule)
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
//line parser.y:64
|
//line parser.y:77
|
||||||
{ yyVAL.boolean = false }
|
{ yyVAL.boolean = false }
|
||||||
case 8:
|
case 8:
|
||||||
//line parser.y:66
|
//line parser.y:79
|
||||||
{ yyVAL.boolean = true }
|
{ yyVAL.boolean = true }
|
||||||
case 9:
|
case 9:
|
||||||
//line parser.y:70
|
//line parser.y:83
|
||||||
{ yyVAL.labelSet = model.LabelSet{} }
|
{ yyVAL.labelSet = model.LabelSet{} }
|
||||||
case 10:
|
case 10:
|
||||||
//line parser.y:72
|
//line parser.y:85
|
||||||
{ yyVAL.labelSet = yyS[yypt-1].labelSet }
|
{ yyVAL.labelSet = yyS[yypt-1].labelSet }
|
||||||
case 11:
|
case 11:
|
||||||
//line parser.y:74
|
//line parser.y:87
|
||||||
{ yyVAL.labelSet = model.LabelSet{} }
|
{ yyVAL.labelSet = model.LabelSet{} }
|
||||||
case 12:
|
case 12:
|
||||||
//line parser.y:77
|
//line parser.y:90
|
||||||
{ yyVAL.labelSet = yyS[yypt-0].labelSet }
|
{ yyVAL.labelSet = yyS[yypt-0].labelSet }
|
||||||
case 13:
|
case 13:
|
||||||
//line parser.y:79
|
//line parser.y:92
|
||||||
{ for k, v := range yyS[yypt-0].labelSet { yyVAL.labelSet[k] = v } }
|
{ for k, v := range yyS[yypt-0].labelSet { yyVAL.labelSet[k] = v } }
|
||||||
case 14:
|
case 14:
|
||||||
//line parser.y:83
|
//line parser.y:96
|
||||||
{ yyVAL.labelSet = model.LabelSet{ model.LabelName(yyS[yypt-2].str): model.LabelValue(yyS[yypt-0].str) } }
|
{ yyVAL.labelSet = model.LabelSet{ model.LabelName(yyS[yypt-2].str): model.LabelValue(yyS[yypt-0].str) } }
|
||||||
case 15:
|
case 15:
|
||||||
//line parser.y:88
|
//line parser.y:101
|
||||||
{ yyVAL.ruleNode = yyS[yypt-1].ruleNode }
|
{ yyVAL.ruleNode = yyS[yypt-1].ruleNode }
|
||||||
case 16:
|
case 16:
|
||||||
//line parser.y:90
|
//line parser.y:103
|
||||||
{ yyS[yypt-0].labelSet["name"] = model.LabelValue(yyS[yypt-1].str); yyVAL.ruleNode = ast.NewVectorLiteral(yyS[yypt-0].labelSet) }
|
{ yyS[yypt-0].labelSet["name"] = model.LabelValue(yyS[yypt-1].str); yyVAL.ruleNode = ast.NewVectorLiteral(yyS[yypt-0].labelSet) }
|
||||||
case 17:
|
case 17:
|
||||||
//line parser.y:92
|
//line parser.y:105
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewFunctionCall(yyS[yypt-3].str, yyS[yypt-1].ruleNodeSlice)
|
yyVAL.ruleNode, err = NewFunctionCall(yyS[yypt-3].str, yyS[yypt-1].ruleNodeSlice)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 18:
|
case 18:
|
||||||
//line parser.y:98
|
//line parser.y:111
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewFunctionCall(yyS[yypt-2].str, []ast.Node{})
|
yyVAL.ruleNode, err = NewFunctionCall(yyS[yypt-2].str, []ast.Node{})
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 19:
|
case 19:
|
||||||
//line parser.y:104
|
//line parser.y:117
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewMatrix(yyS[yypt-3].ruleNode, yyS[yypt-1].str)
|
yyVAL.ruleNode, err = NewMatrix(yyS[yypt-3].ruleNode, yyS[yypt-1].str)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 20:
|
case 20:
|
||||||
//line parser.y:110
|
//line parser.y:123
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewVectorAggregation(yyS[yypt-4].str, yyS[yypt-2].ruleNode, yyS[yypt-0].labelNameSlice)
|
yyVAL.ruleNode, err = NewVectorAggregation(yyS[yypt-4].str, yyS[yypt-2].ruleNode, yyS[yypt-0].labelNameSlice)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 21:
|
case 21:
|
||||||
//line parser.y:118
|
//line parser.y:131
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewArithExpr(yyS[yypt-1].str, yyS[yypt-2].ruleNode, yyS[yypt-0].ruleNode)
|
yyVAL.ruleNode, err = NewArithExpr(yyS[yypt-1].str, yyS[yypt-2].ruleNode, yyS[yypt-0].ruleNode)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 22:
|
case 22:
|
||||||
//line parser.y:124
|
//line parser.y:137
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewArithExpr(yyS[yypt-1].str, yyS[yypt-2].ruleNode, yyS[yypt-0].ruleNode)
|
yyVAL.ruleNode, err = NewArithExpr(yyS[yypt-1].str, yyS[yypt-2].ruleNode, yyS[yypt-0].ruleNode)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 23:
|
case 23:
|
||||||
//line parser.y:130
|
//line parser.y:143
|
||||||
{
|
{
|
||||||
var err error
|
var err error
|
||||||
yyVAL.ruleNode, err = NewArithExpr(yyS[yypt-1].str, yyS[yypt-2].ruleNode, yyS[yypt-0].ruleNode)
|
yyVAL.ruleNode, err = NewArithExpr(yyS[yypt-1].str, yyS[yypt-2].ruleNode, yyS[yypt-0].ruleNode)
|
||||||
if err != nil { yylex.Error(err.Error()); return 1 }
|
if err != nil { yylex.Error(err.Error()); return 1 }
|
||||||
}
|
}
|
||||||
case 24:
|
case 24:
|
||||||
//line parser.y:136
|
//line parser.y:149
|
||||||
{ yyVAL.ruleNode = ast.NewScalarLiteral(yyS[yypt-0].num)}
|
{ yyVAL.ruleNode = ast.NewScalarLiteral(yyS[yypt-0].num)}
|
||||||
case 25:
|
case 25:
|
||||||
//line parser.y:140
|
//line parser.y:153
|
||||||
{ yyVAL.labelNameSlice = []model.LabelName{} }
|
{ yyVAL.labelNameSlice = []model.LabelName{} }
|
||||||
case 26:
|
case 26:
|
||||||
//line parser.y:142
|
//line parser.y:155
|
||||||
{ yyVAL.labelNameSlice = yyS[yypt-1].labelNameSlice }
|
{ yyVAL.labelNameSlice = yyS[yypt-1].labelNameSlice }
|
||||||
case 27:
|
case 27:
|
||||||
//line parser.y:146
|
//line parser.y:159
|
||||||
{ yyVAL.labelNameSlice = []model.LabelName{model.LabelName(yyS[yypt-0].str)} }
|
{ yyVAL.labelNameSlice = []model.LabelName{model.LabelName(yyS[yypt-0].str)} }
|
||||||
case 28:
|
case 28:
|
||||||
//line parser.y:148
|
//line parser.y:161
|
||||||
{ yyVAL.labelNameSlice = append(yyVAL.labelNameSlice, model.LabelName(yyS[yypt-0].str)) }
|
{ yyVAL.labelNameSlice = append(yyVAL.labelNameSlice, model.LabelName(yyS[yypt-0].str)) }
|
||||||
case 29:
|
case 29:
|
||||||
//line parser.y:152
|
//line parser.y:165
|
||||||
{ yyVAL.ruleNodeSlice = []ast.Node{yyS[yypt-0].ruleNode} }
|
{ yyVAL.ruleNodeSlice = []ast.Node{yyS[yypt-0].ruleNode} }
|
||||||
case 30:
|
case 30:
|
||||||
//line parser.y:154
|
//line parser.y:167
|
||||||
{ yyVAL.ruleNodeSlice = append(yyVAL.ruleNodeSlice, yyS[yypt-0].ruleNode) }
|
{ yyVAL.ruleNodeSlice = append(yyVAL.ruleNodeSlice, yyS[yypt-0].ruleNode) }
|
||||||
case 31:
|
case 31:
|
||||||
//line parser.y:158
|
//line parser.y:171
|
||||||
{ yyVAL.ruleNode = yyS[yypt-0].ruleNode }
|
{ yyVAL.ruleNode = yyS[yypt-0].ruleNode }
|
||||||
case 32:
|
case 32:
|
||||||
//line parser.y:160
|
//line parser.y:173
|
||||||
{ yyVAL.ruleNode = ast.NewStringLiteral(yyS[yypt-0].str) }
|
{ yyVAL.ruleNode = ast.NewStringLiteral(yyS[yypt-0].str) }
|
||||||
}
|
}
|
||||||
goto yystack /* stack new state and value */
|
goto yystack /* stack new state and value */
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
// Copyright 2013 Prometheus Team
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package rules
|
package rules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Reference in a new issue