Commit graph

13 commits

Author SHA1 Message Date
Holger Hans Peter Freyther 5edec40d60 promtool: Speed up checking for duplicate rules
Trade space for speed. Convert all rules into our temporary struct, sort
and then iterate. This is a significant when having many rules.

Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
2021-09-06 23:10:26 +08:00
Holger Hans Peter Freyther 3a309c1ae5 promtool: Add simple benchmark checkDuplicates benchmark
Add a simple benchmark with a large number of rules.

Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
2021-09-06 23:10:26 +08:00
Holger Hans Peter Freyther 794937b3d6 promtool: Add testcase for detecting duplicates
Introduce a basic test for checking for duplicate rules.

Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
2021-09-06 23:10:26 +08:00
Levi Harrison ca1896c15b
Promtool: Validate service discovery files (#8950)
* Check SD files in promtool

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-06-29 17:32:59 +02:00
AdaephonBen dca6954b0a
promtool: Add URL scheme when not provided (#7956)
Signed-off-by: AdaephonBen <ma18btech11011@iith.ac.in>
2020-12-23 19:52:04 +01:00
Julien Pivotto 6c56a1faaa
Testify: move to require (#8122)
* Testify: move to require

Moving testify to require to fail tests early in case of errors.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* More moves

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-10-29 09:43:23 +00:00
Julien Pivotto 4e5b1722b3
Move away from testutil, refactor imports (#8087)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-10-22 11:00:08 +02:00
Julien Pivotto 442b3364d7
Promtool: add evaluation time to instant query (#7829)
* Promtool: add evaluation time to instant query

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Apply suggestion

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-25 11:32:25 +01:00
Julius Volz b5c833ca21
Update go.mod dependencies before release (#5883)
* Update go.mod dependencies before release

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Add issue for showing query warnings in promtool

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Revert json-iterator back to 1.1.6

It produced errors when marshaling Point values with special float
values.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fix expected step values in promtool tests after client_golang update

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Update generated protobuf code after proto dep updates

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-08-14 11:00:39 +02:00
Tom Wilkie 851131b074
Allow injection of arbitrary headers in promtool, for auth etc. (#4389)
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2019-06-30 11:50:23 +01:00
beorn7 aff4738f33 Adjust TestQueryRange to new Prometheus API client
Signed-off-by: beorn7 <bjoern@rabenste.in>
2019-05-17 18:09:47 +02:00
stuart nelson 6a69471bc2
[promtool] Support writing output as json (#4848)
* Support writing output as json

Oftentimes I'll want to execute something based on
the output from promtool, and supporting json
makes it easy to pull out values with a supporting
tool such as jq.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-11-14 18:40:07 +01:00
Dave Henderson 73a08f0045 promtool - Adding --step flag to 'query range' subcommand (#4454)
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2018-08-05 11:03:18 +02:00