Skip to contentSkip to conversation

master - libdm: add enum based counter and metric calls

PATCH Bryn Reeves 1 participant 1 message Jul 5, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=82e57660623c6b131632a5ec37deef3428de5399
Commit:        82e57660623c6b131632a5ec37deef3428de5399
Parent:        69f808ac8d25e3c7ef39bd2de66fed1efd290bbe
Author:        Bryn M. Reeves <[email protected]>
AuthorDate:    Mon Feb 29 17:33:16 2016 +0000
Committer:     Bryn M. Reeves <[email protected]>
CommitterDate: Tue Jul 5 19:53:16 2016 +0100

libdm: add enum based counter and metric calls

Add a new enum based interface for accessing counter and metric values that uses a single function for each:

uint64_t dm_stats_get_counter(const struct dm_stats *dms,

                              dm_stats_counter_t counter
                              uint64_t region_id, uint64_t area_id);

int dm_stats_get_metric(const struct dm_stats *dms, int metric,

                        uint64_t region_id, uint64_t area_id,
                        double *value);

This simplifies the implementation of value aggregation for groups of regions. The named function interface now calls the enum interface internally so that all new functionality is available regardless of the method used to retrieve values.

---
 WHATS_NEW_DM                        |    1 +
 libdm/.exported_symbols.DM_1_02_129 |    2 +
 libdm/libdevmapper.h                |   48 +++
 libdm/libdm-stats.c                 |  567 +++++++++++++++++++++--------------
 4 files changed, 396 insertions(+), 222 deletions(-)
WHATS_NEW_DM +1 -0
index 28999f1..59d0cdf 100644
@@ -1,5 +1,6 @@
 Version 1.02.129 - 
 =================================
+  Add enum-driven dm_stats_get_{metric,counter}() interfaces.
   Add dm_bitset_parse_list() to parse a string representation of a bitset.
   Thin dmeventd plugin umounts lvm2 volume only when pool is 95% or more.
 
libdm/.exported_symbols.DM_1_02_129 +2 -0
index fbd2a57..8385362 100644
@@ -1 +1,3 @@
 dm_bitset_parse_list
+dm_stats_get_counter
+dm_stats_get_metric
libdm/libdevmapper.h +48 -0

66 lines not on this page · raw message

libdm/libdm-stats.c +345 -222

687 lines not on this page · raw message