Git Product home page Git Product logo

Comments (1)

holmes1412 avatar holmes1412 commented on June 5, 2024

1.链路追踪
有的。用法可以参考tutorial-01-srpc_pb_server.cc

SRPCServer server;
RPCSpanDefault<RPCTYPESRPC> span_module; // RPCTYPESRPC作为module的模版,配合server使用
server.add_module(&span_module);

tutorial里由于已经有了,你直接跑起来的话,server会得到:

[SPAN_LOG] trace_id: 1317158132757037056 span_id: 1 service: Example method: Echo start: 1627638902336 end_time: 1627638902336 cost: 0 remote_ip: 127.0.0.1 state: 1 error: 0

而client会得到:

[SPAN_LOG] trace_id: 1317158132757037056 span_id: 0 service: Example method: Echo start: 1627638902336 end_time: 1627638902337 cost: 1 remote_ip: 127.0.0.1 state: 1 error: 0
[SPAN_LOG] trace_id: 1317158132757037058 span_id: 1 service: Example method: Echo start: 1627638902336 end_time: 1627638902337 cost: 1 remote_ip: 127.0.0.1 state: 1 error: 0

这是基于RPCModule实现的一种module,用于请求在框架层帮你做的事情。目前span的功能具体实现有两个:RPCSpanDefaultRPCSpanRedis,分别是打log和入redis库(都是异步做的,不会堵住当前请求),这个接口是开放的,如果你有想要对接的可视化工具,可以模仿代码进行派生实现。

另外支持不同采样需求^_^~~~ 比如,刚才的trace_id: 1317158132757037056在server的log里有、而另一条没有,是因为server对于span的采集默认控制了1s只打一条log。所以你可以构造一个RPCSpanFilterPolicy传给RPCSpan的module指定需要的采样。

2.性能测试
不同的协议是用的不同的测试工具,这个在benchmark里有写。比如,测brpc框架,咱们肯定是用brpc-client,然后对srpc框架的brpc协议和brpc框架的brpc协议进行测试对比。thrift也是一样的。画图用的python带着gnu plot画的。

from srpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.