mirror of https://github.com/prometheus/prometheus
Update to go1.1.
This commit updates the documentation, Makefiles, formatting, and code semantics to support the 1.1. runtime, which includes ... 1. ``make advice``, 2. ``make format``, and 3. ``go fix`` on various targets.pull/245/head
parent
2ea2e89c97
commit
244a4a9cdb
|
@ -1,8 +1,8 @@
|
||||||
language: go
|
language: go
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- gvm install go1.0.3 || true
|
- gvm install go1.1 || true
|
||||||
- gvm use go1.0.3 || true
|
- gvm use go1.1 || true
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make
|
- make
|
||||||
|
|
|
@ -25,7 +25,7 @@ else
|
||||||
export THIRD_PARTY_BUILD_OUTPUT :=
|
export THIRD_PARTY_BUILD_OUTPUT :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GO_VERSION := 1.0.3
|
GO_VERSION := 1.1
|
||||||
LEVELDB_VERSION := 1.9.0
|
LEVELDB_VERSION := 1.9.0
|
||||||
PROTOCOL_BUFFERS_VERSION := 2.5.0
|
PROTOCOL_BUFFERS_VERSION := 2.5.0
|
||||||
SNAPPY_VERSION := 1.1.0
|
SNAPPY_VERSION := 1.1.0
|
||||||
|
|
|
@ -18,7 +18,7 @@ action if some condition is observed to be true.
|
||||||
If you read below in the _Getting Started_ section, the build infrastructure
|
If you read below in the _Getting Started_ section, the build infrastructure
|
||||||
will take care of the following things for you in most cases:
|
will take care of the following things for you in most cases:
|
||||||
|
|
||||||
1. Go 1.0.3.
|
1. Go 1.1.
|
||||||
2. GVM: [https://github.com/moovweb/gvm](https://github.com/moovweb/gvm) is highly recommended as well.
|
2. GVM: [https://github.com/moovweb/gvm](https://github.com/moovweb/gvm) is highly recommended as well.
|
||||||
3. LevelDB: [https://code.google.com/p/leveldb/](https://code.google.com/p/leveldb/).
|
3. LevelDB: [https://code.google.com/p/leveldb/](https://code.google.com/p/leveldb/).
|
||||||
4. Protocol Buffers Compiler: [http://code.google.com/p/protobuf/](http://code.google.com/p/protobuf/).
|
4. Protocol Buffers Compiler: [http://code.google.com/p/protobuf/](http://code.google.com/p/protobuf/).
|
||||||
|
@ -39,8 +39,8 @@ For basic help how to get started:
|
||||||
### Working with GVM
|
### Working with GVM
|
||||||
Starting out, the following workflow is advised:
|
Starting out, the following workflow is advised:
|
||||||
|
|
||||||
$ gvm install go1.0.3
|
$ gvm install go1.1
|
||||||
$ gvm use go1.0.3
|
$ gvm use go1.1
|
||||||
$ gvm pkgset create prometheus
|
$ gvm pkgset create prometheus
|
||||||
$ gvm pkgset use prometheus
|
$ gvm pkgset use prometheus
|
||||||
|
|
||||||
|
|
|
@ -105,9 +105,9 @@ func NewFingerprintFromMetric(metric Metric) (f Fingerprint) {
|
||||||
|
|
||||||
return fingerprint{
|
return fingerprint{
|
||||||
firstCharacterOfFirstLabelName: firstCharacterOfFirstLabelName,
|
firstCharacterOfFirstLabelName: firstCharacterOfFirstLabelName,
|
||||||
hash: binary.LittleEndian.Uint64(summer.Sum(nil)),
|
hash: binary.LittleEndian.Uint64(summer.Sum(nil)),
|
||||||
labelMatterLength: uint(labelMatterLength % 10),
|
labelMatterLength: uint(labelMatterLength % 10),
|
||||||
lastCharacterOfLastLabelValue: lastCharacterOfLastLabelValue,
|
lastCharacterOfLastLabelValue: lastCharacterOfLastLabelValue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,4 @@ func (r *registry) ProcessorForRequestHeader(header http.Header) (processor Proc
|
||||||
err = fmt.Errorf("Unrecognized API version %s", prometheusApiVersion)
|
err = fmt.Errorf("Unrecognized API version %s", prometheusApiVersion)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@ func LoadFromReader(rulesReader io.Reader, singleExpr bool) (interface{}, error)
|
||||||
} else {
|
} else {
|
||||||
return lexer.parsedRules, nil
|
return lexer.parsedRules, nil
|
||||||
}
|
}
|
||||||
panic("")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadRulesFromReader(rulesReader io.Reader) ([]Rule, error) {
|
func LoadRulesFromReader(rulesReader io.Reader) ([]Rule, error) {
|
||||||
|
|
|
@ -143,7 +143,7 @@ var testMatrix = ast.Matrix{
|
||||||
{
|
{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "x",
|
model.MetricNameLabel: "x",
|
||||||
"y": "testvalue",
|
"y": "testvalue",
|
||||||
},
|
},
|
||||||
Values: getTestValueStream(0, 100, 10),
|
Values: getTestValueStream(0, 100, 10),
|
||||||
},
|
},
|
||||||
|
|
|
@ -49,8 +49,6 @@ func (c chunk) TruncateBefore(t time.Time) chunk {
|
||||||
default:
|
default:
|
||||||
return c[index-1:]
|
return c[index-1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TieredStorage both persists samples and generates materialized views for
|
// TieredStorage both persists samples and generates materialized views for
|
||||||
|
|
Loading…
Reference in New Issue