63 Commits

Author SHA1 Message Date
Gregor Jasny f448b2c3de feat(iwyu): Organize includes with include-what-you-use 2021-03-03 22:11:10 +01:00
Gregor Jasny d841f00378 core: enforce proper metric and label names
Closes: #421
2020-12-13 16:46:26 +01:00
Gregor Jasny 6d86e2db65 core: Add test for negative observed histogram value
Fixes: #386
2020-11-01 12:11:54 +01:00
Dominik Charousset efce85d54a Use a gauge for the histogram sum
The online docs for Prometheus state:

> The sum of observations (...) behaves like a counter, too, as long as
> there are no negative observations.

A counter can only ever go up and asserts that users pass in only
positive values when incrementing. Hence, the `sum` must use a gauge in
order to stay consistent with the Prometheus documentation.
2020-11-01 12:10:42 +01:00
David Avedissian 7a4b529869 Avoid copying the histogram metric buckets. (#331) 2020-01-30 14:35:42 -08:00
Benjamin Worpitz 7b63978099 Make Collect methods const (#323)
* Make Collect methods const

Collect methods should not influence the state of the objects in any
externally visible way.

* Update ABI version

* Fix interior mutablility problems

Co-authored-by: Jupp Mueller <jupp0r@gmail.com>
2019-12-19 21:37:34 -08: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
Gregor Jasny 5a3ee66c7e fix(symbols): Fix Windows and Bazel symbol visibility 2019-10-18 23:19:17 +02:00
Gregor Jasny b68155af29 chore: Simplify external templates 2019-10-18 09:28:09 +02:00
Gregor Jasny c216ae7ae9 chore(clang-format): Format everything 2019-10-17 18:13:24 +02:00
Gregor Jasny b6a1b4c2fc Implement symbol visibility build system agnostic
Issue: #223
2019-08-31 19:55:13 +02:00
Gregor Jasny 538ed3af0d Add (shared) library versioning
Closes: #223
2019-08-31 18:21:11 +02:00
Gregor Jasny 1bf46d4e32 core: hide builder, family, and registry implementation 2019-08-31 12:41:22 +02: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 a1963aaa2f builder 2019-08-08 09:48:06 -07:00
matthew 35d46a5712 forward declarations and use templatized 2019-08-08 09:48:06 -07:00
matthew 6d47a30b10 use templatized builder 2019-08-07 22:15:55 -07:00
matthew 32cfada5ab delete builders 2019-08-07 22:13:30 -07:00
mkenigs 0b34b87244 typo: lable to label 2019-08-05 23:40:52 -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
Sathiyan Sivathas 17071f49a6 Only check label names when inserting a metric into a family 2019-04-11 17:49:54 +01:00
Jerry Crunctime 81bec36c08 Fix include guard 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
WangQing 3eb59cb930 address comments. 2018-12-06 01:29:29 +08:00
WangQing 80ac75e233 add docs. 2018-12-05 00:17:09 +08:00
WangQing a286647e7b Add docs. 2018-12-05 00:13:25 +08:00
Jovan 858ab06468 Add ut.
Fix

Fix
2018-12-03 02:01:25 +08:00
Jovan daf0d7b509 refactor hash. 2018-12-02 18:29:05 +08:00
Gregor Jasny e712a268bc Merge pull request #229 from jerryct/iosfwd
Use io forward declarations in header
2018-11-24 17:58:51 +01:00
Jerry Crunctime 4819fd542b Use io forward declarations in header 2018-11-17 14:02:45 +01:00
Jerry Crunctime c25b352858 Document builder classes 2018-11-13 20:32:20 +01:00
Jerry Crunctime 74e624ede6 Move builder into detail directory 2018-11-07 21:13:25 +01:00
Jerry Crunctime 8e7cb39328 Squash Add() into one function 2018-11-03 18:06:20 +01:00
Gregor Jasny 10420d624e Merge pull request #177 from jerryct/fix_potential_memory_leak
Fix potential memory leak
2018-11-03 18:00:32 +01:00
Jerry Crunchtime 105a7fc0ee Fix potential memory leak 2018-11-01 15:49:28 +01:00
Jerry Crunctime 2432dc3312 Document Registry 2018-11-01 15:42:24 +01:00
Jerry Crunctime c01558f5b3 Document Collectable interface 2018-11-01 15:36:02 +01:00
Jerry Crunctime f5cf0547c4 Move friend declaration to private section
Semantically there is no difference. It simply cleans
the public interface.
2018-11-01 14:38:39 +01:00
Jerry Crunctime b9b82a12a8 Fix potential memory leak in Family 2018-11-01 11:06:31 +01:00
Jerry Crunctime c981592056 Reword documentation of family class 2018-10-28 16:32:12 +01:00
Jerry Crunctime b039692cf2 Document family class 2018-10-28 12:33:16 +01:00
Jerry Crunchtime 3c39155eb8 Document thread-safety property of metrics 2018-10-27 16:20:49 +02:00
Jerry Crunchtime 8fcf5b0431 Minor refactoring of summary 2018-10-26 11:06:35 +02:00
Jerry Crunchtime 81c46abebf Document summary 2018-10-26 11:06:35 +02:00
Jerry Crunchtime 9c317ef150 Minor refactoring of histogram 2018-10-26 11:05:48 +02:00
Jerry Crunchtime 98a00e44dd Document histogram 2018-10-26 11:05:48 +02:00
Jerry Crunchtime 2774d53f1d Minor refactoring of counter 2018-10-26 11:05:48 +02:00
Jerry Crunchtime e72703077e Minor refactoring of gauge 2018-10-26 11:05:48 +02:00
Jerry Crunchtime 5ac32f36c3 Add test that counter cannot be decremented 2018-10-26 11:05:48 +02:00
Jerry Crunchtime 5e1dfff6a5 Document counter and gauge 2018-10-26 11:05:48 +02:00