Skip to content

Commit

Permalink
Merge pull request #1483 from serverglen/server_error_qps
Browse files Browse the repository at this point in the history
Implement server eps bvar
  • Loading branch information
wwbmmm authored Feb 25, 2022
2 parents 89ed969 + 365a8e3 commit f8069ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/brpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/brpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

};
Expand Down

0 comments on commit f8069ad

Please sign in to comment.