stats: Introduce protobuf message for restore stats

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2013-08-11 13:27:58 +04:00
parent 9bb545011c
commit 729ea690ed
2 changed files with 9 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;