[PATCH 08/18] vinyl: rename vy_quota::dump_bw to dump_bw_hist

Vladimir Davydov vdavydov.dev at gmail.com
Thu Aug 16 19:12:02 MSK 2018


No functional changes. Needed to facilitate review.
---
 src/box/vy_quota.c | 16 ++++++++--------
 src/box/vy_quota.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/box/vy_quota.c b/src/box/vy_quota.c
index 99da69ae..bcdc4c44 100644
--- a/src/box/vy_quota.c
+++ b/src/box/vy_quota.c
@@ -117,9 +117,9 @@ vy_quota_create(struct vy_quota *q, vy_quota_exceeded_f quota_exceeded_cb)
 		700 * MB, 800 * MB, 900 * MB,
 	};
 
-	q->dump_bw = histogram_new(dump_bandwidth_buckets,
-				   lengthof(dump_bandwidth_buckets));
-	if (q->dump_bw == NULL) {
+	q->dump_bw_hist = histogram_new(dump_bandwidth_buckets,
+					lengthof(dump_bandwidth_buckets));
+	if (q->dump_bw_hist == NULL) {
 		diag_set(OutOfMemory, 0, "histogram_new",
 			 "dump bandwidth histogram");
 		return -1;
@@ -128,7 +128,7 @@ vy_quota_create(struct vy_quota *q, vy_quota_exceeded_f quota_exceeded_cb)
 	 * Until we dump anything, assume bandwidth to be 10 MB/s,
 	 * which should be fine for initial guess.
 	 */
-	histogram_collect(q->dump_bw, 10 * MB);
+	histogram_collect(q->dump_bw_hist, 10 * MB);
 
 	q->limit = SIZE_MAX;
 	q->watermark = SIZE_MAX;
@@ -149,7 +149,7 @@ void
 vy_quota_destroy(struct vy_quota *q)
 {
 	ev_timer_stop(loop(), &q->timer);
-	histogram_delete(q->dump_bw);
+	histogram_delete(q->dump_bw_hist);
 	fiber_cond_broadcast(&q->cond);
 	fiber_cond_destroy(&q->cond);
 }
@@ -157,8 +157,8 @@ vy_quota_destroy(struct vy_quota *q)
 size_t
 vy_quota_dump_bandwidth(struct vy_quota *q)
 {
-	/* See comment to vy_quota::dump_bw. */
-	return histogram_percentile(q->dump_bw, 10);
+	/* See comment to vy_quota::dump_bw_hist. */
+	return histogram_percentile(q->dump_bw_hist, 10);
 }
 
 void
@@ -188,7 +188,7 @@ vy_quota_dump(struct vy_quota *q, size_t size, double duration)
 
 	/* Account dump bandwidth. */
 	if (duration > 0)
-		histogram_collect(q->dump_bw, size / duration);
+		histogram_collect(q->dump_bw_hist, size / duration);
 }
 
 int
diff --git a/src/box/vy_quota.h b/src/box/vy_quota.h
index 9bfb48f5..0a7427f0 100644
--- a/src/box/vy_quota.h
+++ b/src/box/vy_quota.h
@@ -102,7 +102,7 @@ struct vy_quota {
 	 * bandwidth to be equal to the 10th percentile, i.e. the
 	 * best result among 10% worst measurements.
 	 */
-	struct histogram *dump_bw;
+	struct histogram *dump_bw_hist;
 };
 
 int
-- 
2.11.0




More information about the Tarantool-patches mailing list