You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by wa...@apache.org on 2023/06/21 04:24:50 UTC
[incubator-pegasus] 37/38: refactor(new_metrics): remove perf-counters that are still used in shared log (#1533)
This is an automated email from the ASF dual-hosted git repository.
wangdan pushed a commit to branch migrate-metrics-dev
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
commit 20eab76d4df89161430560eda72f3bcac4840ff4
Author: Dan Wang <wa...@apache.org>
AuthorDate: Wed Jun 14 19:54:27 2023 +0800
refactor(new_metrics): remove perf-counters that are still used in shared log (#1533)
https://github.com/apache/incubator-pegasus/issues/1532
In https://github.com/apache/incubator-pegasus/pull/1462, all metrics of
shared log have been removed. However, there are still some perf-counters
that are used in shared log. All of them should be removed.
---
src/replica/mutation_log.cpp | 6 ------
src/replica/mutation_log.h | 16 +++++-----------
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/src/replica/mutation_log.cpp b/src/replica/mutation_log.cpp
index c618c7cd4..25573120d 100644
--- a/src/replica/mutation_log.cpp
+++ b/src/replica/mutation_log.cpp
@@ -39,8 +39,6 @@
#include "common/replication.codes.h"
#include "consensus_types.h"
#include "mutation_log_utils.h"
-#include "perf_counter/perf_counter.h"
-#include "perf_counter/perf_counter_wrapper.h"
#include "replica.h"
#include "replica/log_block.h"
#include "replica/log_file.h"
@@ -184,10 +182,6 @@ void mutation_log_shared::commit_pending_mutations(log_file_ptr &lf,
// FIXME : the file could have been closed
lf->flush();
}
-
- if (_write_size_counter) {
- (*_write_size_counter)->add(sz);
- }
} else {
LOG_ERROR("write shared log failed, err = {}", err);
}
diff --git a/src/replica/mutation_log.h b/src/replica/mutation_log.h
index 6636f808a..b84f46d5b 100644
--- a/src/replica/mutation_log.h
+++ b/src/replica/mutation_log.h
@@ -54,7 +54,6 @@
namespace dsn {
class binary_writer;
-class perf_counter_wrapper;
namespace replication {
@@ -241,9 +240,9 @@ public:
//
bool get_learn_state(gpid gpid, decree start, /*out*/ learn_state &state) const;
- // only valid for private log
- // get parent mutations in memory and private log files during partition split
- // total_file_size is used for split perf-counter
+ // only valid for private log.
+ // get parent mutations in memory and private log files during partition split.
+ // `total_file_size` is used for the metrics of partition split.
void get_parent_mutations_and_logs(gpid pid,
decree start_decree,
ballot start_ballot,
@@ -399,14 +398,10 @@ typedef dsn::ref_ptr<mutation_log> mutation_log_ptr;
class mutation_log_shared : public mutation_log
{
public:
- mutation_log_shared(const std::string &dir,
- int32_t max_log_file_mb,
- bool force_flush,
- perf_counter_wrapper *write_size_counter = nullptr)
+ mutation_log_shared(const std::string &dir, int32_t max_log_file_mb, bool force_flush)
: mutation_log(dir, max_log_file_mb, dsn::gpid(), nullptr),
_is_writing(false),
- _force_flush(force_flush),
- _write_size_counter(write_size_counter)
+ _force_flush(force_flush)
{
}
@@ -448,7 +443,6 @@ private:
std::shared_ptr<log_appender> _pending_write;
bool _force_flush;
- perf_counter_wrapper *_write_size_counter;
};
class mutation_log_private : public mutation_log, private replica_base
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org