Commit Graph

2 Commits

Author SHA1 Message Date
Paul Mathieu
2182c6688c pw_metric: add _STATIC variants
This adds PW_METRIC_STATIC and PW_METRIC_GROUP_STATIC, which do the same
as their non-_STATIC siblings, except that the object that they create
gets a `static` storage.

This can be useful, e.g. to have metrics inside of functions, when the
function itself is to be instrumented.

This CL also removes an extraneous stringification in the metric and
group names, which resulted in double double quotes.

Ah, and I also implemented PW_METRIC_GROUP with 3 parameters, which was
referenced in the documentation but not formally implemented.

Change-Id: Ife06f3759c49cb5cc15a571334e65b8f48051a6c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16980
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-08-31 18:26:09 +00:00
Keir Mierle
45fa7859d8 pw_metric: Create new module
This starts the metrics module, which will eventually offer facilities
to track metrics about a system, like average memory use, or other
performance counters.

Change-Id: I2b9dd089cbc2a15af295661fda6f8a6c30353d45
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15441
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Fateh Singh <fsingh@google.com>
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
2020-08-14 02:38:03 +00:00