72 Star 329 Fork 136

百度开源 / BRPC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
builtin_service.md 2.87 KB
一键复制 编辑 原始数据 按行查看 历史
gejun 提交于 2017-10-09 16:24 . Minor change to docs/en/builtin_service.md

中文版

Builtin Services

Builtin services expose internal status of servers in different pespectives, making development and debugging over brpc more efficient. brpc serves builting services via HTTP, which can be easily accessed through curl and web browsers. Servers respond plain text or html according to User-Agent in the request header, or you may append ?console=1 to the uri to force the server to respond in plain text. Check the example running on our dev machine(only accessible from Baidu internal) for more details. If the port is forbidden from where you run curl or web browser (e.g. not all ports are accessible from a web browser inside Baidu), you can use rpc_view for proxying.

Following 2 screenshots show accesses to builtin services from a web browser and a terminal respectively. Note that the logo is the codename inside Baidu, and being modified to brpc in opensourced version.

From a web browser

img

From a terminal

img

Security Mode

To avoid potential attacks and information leaks, builtin services must be hidden on servers that may be accessed from public, including the ones proxied by nginx or other http servers. Click here for more details.

Main services:

/status: displays brief status of all services.

/vars: lists user-customizable counters on miscellaneous metrics.

/connections: lists all connections and their stats.

/flags: lists all gflags, some of them are modifiable at run-time.

/rpcz: traces all RPCs.

cpu profiler: analyzes CPU hotspots.

heap profiler: shows how memory are allocated.

contention profiler: analyzes lock contentions.

Other services

/version shows version of the server. Call Server::set_version() to specify version of the server, or brpc would generate a default version like brpc_server_<service-name1>_<service-name2> ...

img

/health shows whether this server is alive or not.

img

/protobufs shows scheme of all protobuf messages inside the server.

img

/vlog shows all the VLOG that can be enabled(not working with glog).

img

/dir: browses all files on the server, convenient but too dangerous, disabled by default.

/threads: displays information of all threads of the process, hurting performance significantly when being turned on, disabled by default.

C/C++
1
https://gitee.com/baidu/BRPC.git
git@gitee.com:baidu/BRPC.git
baidu
BRPC
BRPC
master

搜索帮助