Make member function as const whenever possible.

Test: unit tests passed.
Change-Id: I751cabf305a4b5aa2095853cc951837da0df4c78
diff --git a/cmds/statsd/src/metrics/CountMetricProducer.cpp b/cmds/statsd/src/metrics/CountMetricProducer.cpp
index a5ce389..149b9c1 100644
--- a/cmds/statsd/src/metrics/CountMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/CountMetricProducer.cpp
@@ -247,7 +247,7 @@
 // Rough estimate of CountMetricProducer buffer stored. This number will be
 // greater than actual data size as it contains each dimension of
 // CountMetricData is  duplicated.
-size_t CountMetricProducer::byteSize() {
+size_t CountMetricProducer::byteSize() const {
     size_t totalSize = 0;
     for (const auto& pair : mPastBuckets) {
         totalSize += pair.second.size() * kBucketSize;