aboutsummaryrefslogtreecommitdiffstats
path: root/src/statistics.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-02 15:57:34 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-02 15:57:34 +0100
commitd7b0577d7d30139491b5cfeffb467440f9e88818 (patch)
tree0666fa8f415a47e8f5645dd87ad8844251251c6a /src/statistics.c
parentc84851bccc2e5e60536afa474a5f13134a3b79c9 (diff)
parent8f0374f7521376bdb721e821047e8a6a4a727283 (diff)
Merge branch 'jerlbeck/wip/stats'
* This adds a new counter type (to measure time or delay) * A statsd reporting backend. This can be fed into graphite or similar tools. * A periodic log backend for performance values
Diffstat (limited to 'src/statistics.c')
-rw-r--r--src/statistics.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/statistics.c b/src/statistics.c
index e28541ba..ad069cea 100644
--- a/src/statistics.c
+++ b/src/statistics.c
@@ -74,3 +74,11 @@ struct osmo_counter *osmo_counter_get_by_name(const char *name)
}
return NULL;
}
+
+int osmo_counter_difference(struct osmo_counter *ctr)
+{
+ int delta = ctr->value - ctr->previous;
+ ctr->previous = ctr->value;
+
+ return delta;
+}