From 729ea690ed5e412f32d22380acd7643bd95b06e5 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Sun, 11 Aug 2013 13:27:58 +0400 Subject: [PATCH] stats: Introduce protobuf message for restore stats Signed-off-by: Pavel Emelyanov --- protobuf/stats.proto | 4 ++++ stats.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/protobuf/stats.proto b/protobuf/stats.proto index 0e909d9f0..6aad3c136 100644 --- a/protobuf/stats.proto +++ b/protobuf/stats.proto @@ -10,6 +10,10 @@ message dump_stats_entry { required uint64 pages_written = 7; } +message restore_stats_entry { +} + message stats_entry { optional dump_stats_entry dump = 1; + optional restore_stats_entry restore = 2; } diff --git a/stats.c b/stats.c index 97ab61878..f75488d28 100644 --- a/stats.c +++ b/stats.c @@ -81,6 +81,7 @@ void write_stats(int what) { StatsEntry stats = STATS_ENTRY__INIT; DumpStatsEntry ds_entry = DUMP_STATS_ENTRY__INIT; + RestoreStatsEntry rs_entry = RESTORE_STATS_ENTRY__INIT; char *name; int fd; @@ -98,6 +99,10 @@ void write_stats(int what) ds_entry.pages_written = dstats->counts[CNT_PAGES_WRITTEN]; name = "dump"; + } else if (what == RESTORE_STATS) { + stats.restore = &rs_entry; + + name = "restore"; } else return;