52 Commits

Author SHA1 Message Date
Gregor Jasny 2412990ee9 core: avoid collecting empty metric families 2021-03-09 13:21:22 +01:00
Gregor Jasny 1d36d42210 core: Replace name check regex (#462)
* core: test for more invalid lables

* core: rewrite label and metric name checks

The std::regex has the problem that it is not available everywhere
and also it's 75 times slower than the naive validity check.

```
BM_Label_Check_Regex          550 ns          550 ns      1270601
BM_Label_Check_NoRegex       7.50 ns         7.50 ns     92802503
```
2021-03-08 11:29:25 -08:00
Gregor Jasny 77b06a8709 core: reject duplicate label names (#463)
Issue: #459
2021-03-08 11:28:04 -08:00
Gregor Jasny f448b2c3de feat(iwyu): Organize includes with include-what-you-use 2021-03-03 22:11:10 +01:00
Gregor Jasny bf0ddfc57b fix: use printf %g or std::to_chars to serialize doubles
This will result in floating point numbers redered with the
necessary precision and avoids trailing zeroes.

Closes: #441
2021-01-10 00:31:14 +01:00
Gregor Jasny acab56c808 chore: re-format with clang-format 11 2020-12-14 20:05:20 +01:00
Gregor Jasny d841f00378 core: enforce proper metric and label names
Closes: #421
2020-12-13 16:46:26 +01:00
Jupp Mueller 01c11d5bd6 Fix insufficiently precise value rendering
This change fixes #407 by increasing precision for rendered floating point numbers
output in the text serializer.
2020-11-06 09:53:23 -08:00
Gregor Jasny 6d86e2db65 core: Add test for negative observed histogram value
Fixes: #386
2020-11-01 12:11:54 +01:00
Gregor Jasny 054b49ba4a core: allow logically negative gauge increments and decrements
This is in-line with the golang prometheus client library.
2020-11-01 12:09:08 +01:00
Gregor Jasny 5c771de785 core: Skip serialization test if locale is not available
Closes: #345
2020-03-13 13:21:57 +01:00
Gregor Jasny 62d673f09c feat(core): Expect working German locale 2020-02-29 16:04:09 +01:00
Gregor Jasny 3018a51030 feat(pull): Add getter for listening ports
Closes: #334
2020-02-12 21:01:44 +01:00
Gregor Jasny 582dbb0295 feat(core): Improve text_serializer.cc coverage 2019-11-03 16:43:47 +01:00
Gregor Jasny 2be75c533f fix(core): Properly serialize newlines in label values 2019-11-03 15:58:10 +01:00
Gregor Jasny f2a296ead8 feat(core): Improve text_serializer.cc coverage 2019-11-01 18:43:24 +01:00
Gregor Jasny ca0b1e50c4 feat(core): Improve family.cc coverage 2019-11-01 18:43:18 +01:00
Gregor Jasny c57ae5728f fix(core): Make registry insert behavior configurable
Add three different insert strategies for the Registry.
The `NonStandardAppend` is only there and selected for
backward compatibility and most likely will go away
in the future.
2019-10-25 10:31:48 +02:00
Jupp Mueller 444a7a916e Merge pull request #302 from gjasny/use-github-actions
Use GitHub actions
2019-10-22 08:23:54 -07:00
Gregor Jasny 70a1cfd60a Merge pull request #305 from jupp0r/code-format
Code format
2019-10-18 09:04:13 +02:00
Gregor Jasny c216ae7ae9 chore(clang-format): Format everything 2019-10-17 18:13:24 +02:00
Gregor Jasny 203f7f6e70 chore(bazel): Use True / False in boolean context 2019-10-17 18:07:44 +02:00
Gregor Jasny 3667f3ebb1 core: Do not run locale test on Windows 2019-09-26 22:21:59 +02:00
Jupp Mueller a0ea1d0e5b Merge pull request #296 from Metaswitch/histogram-observe-multiple
Fix Histogram::ObserveMultiple bug.

Now throw length_error if the number of bucket increments is not equal to the
number of buckets in the histogram.
2019-08-15 10:48:53 -07:00
David Ray eb6f1ab157 Fix Histogram::ObserveMultiple bug. Now throw length_error if the number of bucket increments is not equal to the
number of buckets in the histogram.
2019-08-14 14:03:20 +01:00
Jupp Mueller 2252249259 Merge pull request #290 from Metaswitch/histogram-observe-multiple
Allow more than one histogram observation at a time
2019-08-08 17:41:12 -07:00
matthew a34ead7027 include fixes 2019-08-08 09:52:41 -07:00
David Ray 00d1c4cc95 Allow more than 1 histogram observation at a time
Added the ObserveMultiple method to the Histogram. This is useful
if you have already have values sorted into buckets, and the sum of
the values but no longer have the individual values.
2019-08-05 16:44:00 +01:00
Gregor Jasny 1b1a99d862 core: Serialize floating values locale-independent
Closes: #281
2019-06-30 20:49:34 +02:00
Gregor Jasny afef90f43e core: Improve test coverage 2019-04-28 16:30:54 +02:00
Jerry Crunctime e38d0206c9 Fix all warnings 2018-12-08 11:15:23 +01:00
Gregor Jasny e85603a41f Reformat everything
using clang-format version 8.0.0 (tags/google/stable/2018-10-04)
2018-12-06 20:43:41 +01:00
Jovan ba29cac14f Address comments. 2018-12-07 00:16:37 +08:00
Jovan 4e1c324824 Fix 2018-12-06 12:45:18 +08:00
Jovan 858ab06468 Add ut.
Fix

Fix
2018-12-03 02:01:25 +08:00
Gregor Jasny 054b51a6eb Relax death test regex for macOS 2018-11-09 14:02:46 +01:00
Jerry Crunctime b9b82a12a8 Fix potential memory leak in Family 2018-11-01 11:06:31 +01:00
Jerry Crunctime 7607cbe217 Add missing return statement of non-void function 2018-11-01 11:06:27 +01:00
Jerry Crunctime a13d952f14 Be explicit about cause of death 2018-11-01 11:06:00 +01:00
Jerry Crunctime 2b001774d3 Get rid of NDEBUG macro in DEATH test 2018-11-01 11:03:05 +01:00
Gregor Jasny 9399ac8121 Prefer EXPECT_EQ/GT over EXPECT_THAT 2018-10-28 11:35:54 +01:00
Jerry Crunctime 62545a4646 Fix include order 2018-10-28 09:10:28 +01:00
Jerry Crunctime 92ab1c8b51 Remove using-directives 2018-10-28 09:10:28 +01:00
Jerry Crunctime ef7fc15641 Remove superfluous test fixture 2018-10-28 09:09:59 +01:00
Jerry Crunctime 391dd3738b Remove dead code 2018-10-28 08:59:48 +01:00
Jerry Crunchtime 5ac32f36c3 Add test that counter cannot be decremented 2018-10-26 11:05:48 +02:00
Jerry Crunchtime 01a8e63c3d Move benchmarks to top-level directory 2018-10-26 09:44:45 +02:00
Jerry Crunchtime 354e4216ed Refactor CMake 2018-10-19 16:42:23 +02:00
Jerry Crunchtime 9260841e47 Remove dead test code 2018-10-17 10:25:38 +02:00
Gregor Jasny f12056635c Use external google mock when requested 2018-10-13 14:08:09 -04:00