Commit graph

7 commits

Author SHA1 Message Date
Miek Gieben
94c59da577 Run tests in parallel (#478)
Create a small speedup running the tests:

PASS
ok  	github.com/miekg/coredns/test	10.329s

PASS
ok  	github.com/miekg/coredns/test	6.079s

Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield
any speedup as these are still done on a per directory basis.
2017-01-12 08:13:50 +00:00
Miek Gieben
d6902cd7a1 Disable metrics test (#380)
Disable this test (for now), it fails weirdly on travis
(and not locally). Initial suspicion that another server
is still reporting (or something). Anyway hard to replicate
locally - disable it for now.
2016-11-05 14:38:49 +00:00
Ben Kochie
775d26c5e2 Add metrics for cache hits/misses (#375)
* Add metrics for cache hits/misses

Add counters for cache middleware hits and misses.

* Add test for cache middleware hit/miss counters.

* Fix cache hit metric incrementing.

* Add cache hit/miss metrics to dnssec middleware.

* Update README metric documentation.
2016-10-31 18:50:50 +00:00
Miek Gieben
81d5baee28 middleware/cache: fix metrics test
Fix the metrics test, top-level test directory still referenced the
old metrics name.
2016-10-30 15:08:40 +00:00
Miek Gieben
cb867ff6bd middleware/metrics: export ListenAddr (#366)
ListenAddr is the address where the prometheus metric are exported.
This can be used in tests to listen on "localhost:0" and then later
retrieve the metrics from there. It makes the tests indepent on each
other.
2016-10-28 12:57:10 +01:00
Miek Gieben
219bfd0493 middleware/metrics: cleanup (#355)
* middleware/metrics: add more metrics

middleware/cache:
Add metrics for number of elements in the cache. Also export the total
size. Update README to detail the new metrics.

middleware/metrics

Move metrics into subpackage called "vars". This breaks the import
cycle and is cleaner. This allows vars.Report to be used in the
the dnsserver to log refused queries.

middleware/metrics: tests

Add tests to the metrics framework. The metrics/test subpackage allows
scraping of the local server. Do a few test scrape of the metrics that
are defined in the metrics middleware.

This also allows metrics integration tests to check if the caching and
dnssec middleware export their metrics correctly.

* update README

* typos

* fix tests
2016-10-26 10:01:52 +01:00
Miek Gieben
db6c9a3f01 middleware/metrics: fix crash on startup (#318)
Make the methods that handle Metrics all use pointer receivers to fix
sync.Once not being initialized.

Finish the setup_test to test for failures. And make the check for the
address more strict and return an error when it does not have a port
number.

Add a toplevel test that starts a CoreDNS server with metrics enabled
so we catch these errors in the future.
2016-10-04 11:05:04 +01:00