You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ww...@apache.org on 2022/02/25 09:47:04 UTC
[incubator-brpc] branch master updated: Implement server eps bvar
This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 365a8e3 Implement server eps bvar
new f8069ad Merge pull request #1483 from serverglen/server_error_qps
365a8e3 is described below
commit 365a8e384cfd37d79fc0e2ba37fec4273f195973
Author: liushuai06 <li...@baidu.com>
AuthorDate: Thu Jul 15 23:39:45 2021 +0800
Implement server eps bvar
---
src/brpc/server.cpp | 3 +++
src/brpc/server.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/brpc/server.cpp b/src/brpc/server.cpp
index 2fb3c00..9f05e2c 100644
--- a/src/brpc/server.cpp
+++ b/src/brpc/server.cpp
@@ -283,6 +283,8 @@ void* Server::UpdateDerivedVars(void* arg) {
server->_nerror_bvar.expose_as(prefix, "error");
+ server->_eps_bvar.expose_as(prefix, "eps");
+
bvar::PassiveStatus<timeval> uptime_st(
prefix, "uptime", GetUptime, (void*)(intptr_t)start_us);
@@ -391,6 +393,7 @@ Server::Server(ProfilerLinker)
, _last_start_time(0)
, _derivative_thread(INVALID_BTHREAD)
, _keytable_pool(NULL)
+ , _eps_bvar(&_nerror_bvar)
, _concurrency(0) {
BAIDU_CASSERT(offsetof(Server, _concurrency) % 64 == 0,
Server_concurrency_must_be_aligned_by_cacheline);
diff --git a/src/brpc/server.h b/src/brpc/server.h
index 47bb854..886fc21 100644
--- a/src/brpc/server.h
+++ b/src/brpc/server.h
@@ -679,6 +679,7 @@ friend class Controller;
// mutable is required for `ServerPrivateAccessor' to change this bvar
mutable bvar::Adder<int64_t> _nerror_bvar;
+ mutable bvar::PerSecond<bvar::Adder<int64_t> > _eps_bvar;
mutable int32_t BAIDU_CACHELINE_ALIGNMENT _concurrency;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org