summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKefu Chai <tchaikov@gmail.com>2018-01-26 08:30:11 +0100
committerGitHub <noreply@github.com>2018-01-26 08:30:11 +0100
commitc641b205a828419b9585803353919b87b7d68c4d (patch)
treee4b825430040e6ea3fd56809cb83b12b803d4918 /src
parentMerge pull request #20048 from jcsp/wip-22096 (diff)
parentmon: use pool_sum as param name in PGMapDigest::recovery_summary (diff)
downloadceph-c641b205a828419b9585803353919b87b7d68c4d.tar.xz
ceph-c641b205a828419b9585803353919b87b7d68c4d.zip
Merge pull request #20009 from Liuchang0812/fix-22727
mon: do not use per_pool_sum_delta to show recovery summary Reviewed-by: Varada Kari <varada.kari@gmail.com> Reviewed-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/mon/PGMap.cc50
-rw-r--r--src/mon/PGMap.h2
2 files changed, 26 insertions, 26 deletions
diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc
index 884e99d11f4..47d825c5fa9 100644
--- a/src/mon/PGMap.cc
+++ b/src/mon/PGMap.cc
@@ -392,53 +392,53 @@ void PGMapDigest::print_oneline_summary(Formatter *f, ostream *out) const
}
void PGMapDigest::recovery_summary(Formatter *f, list<string> *psl,
- const pool_stat_t& delta_sum) const
+ const pool_stat_t& pool_sum) const
{
- if (delta_sum.stats.sum.num_objects_degraded && delta_sum.stats.sum.num_object_copies > 0) {
- double pc = (double)delta_sum.stats.sum.num_objects_degraded /
- (double)delta_sum.stats.sum.num_object_copies * (double)100.0;
+ if (pool_sum.stats.sum.num_objects_degraded && pool_sum.stats.sum.num_object_copies > 0) {
+ double pc = (double)pool_sum.stats.sum.num_objects_degraded /
+ (double)pool_sum.stats.sum.num_object_copies * (double)100.0;
char b[20];
snprintf(b, sizeof(b), "%.3lf", pc);
if (f) {
- f->dump_unsigned("degraded_objects", delta_sum.stats.sum.num_objects_degraded);
- f->dump_unsigned("degraded_total", delta_sum.stats.sum.num_object_copies);
+ f->dump_unsigned("degraded_objects", pool_sum.stats.sum.num_objects_degraded);
+ f->dump_unsigned("degraded_total", pool_sum.stats.sum.num_object_copies);
f->dump_float("degraded_ratio", pc / 100.0);
} else {
ostringstream ss;
- ss << delta_sum.stats.sum.num_objects_degraded
- << "/" << delta_sum.stats.sum.num_object_copies << " objects degraded (" << b << "%)";
+ ss << pool_sum.stats.sum.num_objects_degraded
+ << "/" << pool_sum.stats.sum.num_object_copies << " objects degraded (" << b << "%)";
psl->push_back(ss.str());
}
}
- if (delta_sum.stats.sum.num_objects_misplaced && delta_sum.stats.sum.num_object_copies > 0) {
- double pc = (double)delta_sum.stats.sum.num_objects_misplaced /
- (double)delta_sum.stats.sum.num_object_copies * (double)100.0;
+ if (pool_sum.stats.sum.num_objects_misplaced && pool_sum.stats.sum.num_object_copies > 0) {
+ double pc = (double)pool_sum.stats.sum.num_objects_misplaced /
+ (double)pool_sum.stats.sum.num_object_copies * (double)100.0;
char b[20];
snprintf(b, sizeof(b), "%.3lf", pc);
if (f) {
- f->dump_unsigned("misplaced_objects", delta_sum.stats.sum.num_objects_misplaced);
- f->dump_unsigned("misplaced_total", delta_sum.stats.sum.num_object_copies);
+ f->dump_unsigned("misplaced_objects", pool_sum.stats.sum.num_objects_misplaced);
+ f->dump_unsigned("misplaced_total", pool_sum.stats.sum.num_object_copies);
f->dump_float("misplaced_ratio", pc / 100.0);
} else {
ostringstream ss;
- ss << delta_sum.stats.sum.num_objects_misplaced
- << "/" << delta_sum.stats.sum.num_object_copies << " objects misplaced (" << b << "%)";
+ ss << pool_sum.stats.sum.num_objects_misplaced
+ << "/" << pool_sum.stats.sum.num_object_copies << " objects misplaced (" << b << "%)";
psl->push_back(ss.str());
}
}
- if (delta_sum.stats.sum.num_objects_unfound && delta_sum.stats.sum.num_objects) {
- double pc = (double)delta_sum.stats.sum.num_objects_unfound /
- (double)delta_sum.stats.sum.num_objects * (double)100.0;
+ if (pool_sum.stats.sum.num_objects_unfound && pool_sum.stats.sum.num_objects) {
+ double pc = (double)pool_sum.stats.sum.num_objects_unfound /
+ (double)pool_sum.stats.sum.num_objects * (double)100.0;
char b[20];
snprintf(b, sizeof(b), "%.3lf", pc);
if (f) {
- f->dump_unsigned("unfound_objects", delta_sum.stats.sum.num_objects_unfound);
- f->dump_unsigned("unfound_total", delta_sum.stats.sum.num_objects);
+ f->dump_unsigned("unfound_objects", pool_sum.stats.sum.num_objects_unfound);
+ f->dump_unsigned("unfound_total", pool_sum.stats.sum.num_objects);
f->dump_float("unfound_ratio", pc / 100.0);
} else {
ostringstream ss;
- ss << delta_sum.stats.sum.num_objects_unfound
- << "/" << delta_sum.stats.sum.num_objects << " objects unfound (" << b << "%)";
+ ss << pool_sum.stats.sum.num_objects_unfound
+ << "/" << pool_sum.stats.sum.num_objects << " objects unfound (" << b << "%)";
psl->push_back(ss.str());
}
}
@@ -500,11 +500,11 @@ void PGMapDigest::pool_recovery_rate_summary(Formatter *f, ostream *out,
void PGMapDigest::pool_recovery_summary(Formatter *f, list<string> *psl,
uint64_t poolid) const
{
- auto p = per_pool_sum_delta.find(poolid);
- if (p == per_pool_sum_delta.end())
+ auto p = pg_pool_sum.find(poolid);
+ if (p == pg_pool_sum.end())
return;
- recovery_summary(f, psl, p->second.first);
+ recovery_summary(f, psl, p->second);
}
void PGMapDigest::client_io_rate_summary(Formatter *f, ostream *out,
diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h
index 42719df952c..9fb54a17881 100644
--- a/src/mon/PGMap.h
+++ b/src/mon/PGMap.h
@@ -101,7 +101,7 @@ public:
void print_oneline_summary(Formatter *f, ostream *out) const;
void recovery_summary(Formatter *f, list<string> *psl,
- const pool_stat_t& delta_sum) const;
+ const pool_stat_t& pool_sum) const;
void overall_recovery_summary(Formatter *f, list<string> *psl) const;
void pool_recovery_summary(Formatter *f, list<string> *psl,
uint64_t poolid) const;