You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/admin_service.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# Overview
4
4
5
-
The tRPC-Cpp comes with a built-in management service based on the HTTP protocol, providing a set of operational management interfaces for users to view and modify the status of the service. Users can invoke these management commands through a web browser or by constructing HTTP requests manually.
5
+
The tRPC-Cpp comes with a built-in management service based on HTTP protocol, providing a set of operation and management interfaces for users to view and modify the status of services. Users can invoke these management commands through a web browser or by constructing HTTP requests manually.
6
6
7
7
This document introduces the usage of the management service, where developers can learn the following topics:
8
8
@@ -34,13 +34,13 @@ server:
34
34
35
35
The framework provides a set of built-in management commands that allow users to conveniently view and modify the service status.
36
36
37
-
## The way to access
37
+
## The ways to access
38
38
39
39
The framework's built-in management commands can be invoked in two ways.
40
40
41
-
### Access via a web browser
41
+
### Access via web browser
42
42
43
-
Users can enter `http://admin_ip:admin_port` in a web browser to access the web homepage of the tRPC-Cpp management service. From there, you can click on the corresponding links for each module to perform operations.
43
+
Users can enter `http://admin_ip:admin_port` in a web browser to access the web homepage of the tRPC-Cpp management service. From there, users can click on the corresponding links for each module to perform operations.
44
44
45
45

46
46
@@ -53,9 +53,9 @@ The functionality of each module on the homepage is described as follows.
53
53
| heap | View the memory usage. |
54
54
| logs | View and modify the log level of the framework. |
55
55
| stats | View the server-side statistics such as connection count, request count, latency information, etc. |
56
-
| sysvars | View the system resource information, such as CPU configuration, load, IO, and memory usage of current process, etc. |
56
+
| sysvars | View the system resource information, such as CPU configuration, load, IO and memory usage of current process, etc. |
57
57
58
-
### Invoke by constructing HTTP requests manually
58
+
### Access via constructing HTTP requests manually
59
59
60
60
Users can construct HTTP requests manually to invoke the management commands provided by the framework, for example, by using the curl tool. The list of available management commands for invocation is as follows.
61
61
@@ -277,7 +277,7 @@ The statistical variables currently provided by the framework are as follows.
277
277
278
278
#### The way to enable
279
279
280
-
**By default, tRPC-Cpp does not allow CPU and memory usage information to be collected through management commands. If you need to collect related information, you need to add the "TRPC_ENABLE_PROFILER" macro definition and link "tcmalloc_and_profiler" when compiling the program.**
280
+
**By default, tRPC-Cpp does not allow CPU and memory usage information to be collected through management commands. If related information needs to be collected, users need to add the "TRPC_ENABLE_PROFILER" macro definition and link "tcmalloc_and_profiler" when compiling the program.**
281
281
282
282
Below, we will introduce the ways to enable this feature in Bazel and CMake, respectively.
283
283
@@ -298,14 +298,14 @@ Below, we will introduce the ways to enable this feature in Bazel and CMake, res
298
298
299
299
Using this compilation option will automatically define the "TRPC_ENABLE_PROFILER" macro, but users need to manually link "libtcmalloc_and_profiler".
300
300
301
-
For example, if the user's "libtcmalloc_and_profiler.so" is located in the "/user-path/lib" directory, you can add the compilation option in the .bazelrc file like this:
301
+
For example, if the user's "libtcmalloc_and_profiler.so" is located in the "/user-path/lib" directory, add the compilation option in the .bazelrc file like this:
302
302
303
303
```sh
304
304
# In the .bazelrc file
305
305
build --define trpc_enable_profiler_v2=true
306
306
```
307
307
308
-
And Then link the "libtcmalloc_and_profiler" in the BUILD file of the server:
308
+
And then link the "libtcmalloc_and_profiler" in the BUILD file of the server:
309
309
310
310
```bzl
311
311
cc_binary(
@@ -320,14 +320,14 @@ Below, we will introduce the ways to enable this feature in Bazel and CMake, res
320
320
321
321
3. Define the "TRPC_ENABLE_PROFILER" macro and link "tcmalloc_and_profiler" manually.
322
322
323
-
For example, you can add the compilation macro in the .bazelrc file like this:
323
+
For example, add the compilation macro in the .bazelrc file like this:
324
324
325
325
```sh
326
326
# In the .bazelrc file
327
327
build --copt='-DTRPC_ENABLE_PROFILER'
328
328
```
329
329
330
-
And Then link the "libtcmalloc_and_profiler" in the BUILD file of the server:
330
+
And then link the "libtcmalloc_and_profiler" in the BUILD file of the server:
331
331
332
332
```bzl
333
333
cc_binary(
@@ -342,7 +342,7 @@ Below, we will introduce the ways to enable this feature in Bazel and CMake, res
342
342
343
343
##### CMake
344
344
345
-
You need to define "TRPC_ENABLE_PROFILER" and link "tcmalloc_and_profiler" in the CMakeLists.txt file.
345
+
Users need to define "TRPC_ENABLE_PROFILER" and link "tcmalloc_and_profiler" in the CMakeLists.txt file.
The tRPC-Cpp allows users to customize and register management commands to perform additional management operations as needed by the user. For specific usage examples, please refer to the [admin example](../../examples/features/admin/proxy/).
467
+
The tRPC-Cpp allows users to customize and register management commands to perform additional management operations as needed. For specific usage examples, please refer to the [admin example](../../examples/features/admin/proxy/).
468
468
469
469
Usage:
470
470
@@ -494,7 +494,7 @@ Usage:
494
494
You can choose to override the `CommandHandle` interface or the `Handle` interface to implement the control logic.
495
495
496
496
* CommandHandle: It can conveniently return data in JSON format, suitable for commands accessed through the command line.
497
-
* Handle: It allows flexible control over the format of the returned results, for example, returning data in HTML format.
497
+
* Handle: It allows flexible control over the format of the returned results, for example, return data in HTML format.
Copy file name to clipboardExpand all lines: docs/en/architecture_design.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ The implementation of framework core mainly includes the following modules:
40
40
- client: provides a concurrent and safe general-purpose client implementation, which is mainly responsible for operations related to rpc calls, service discovery, load balancing, circuit breaker, encoding and decoding, and custom filter. All parts support plugin extensions;
41
41
- codec: provides codec-related interfaces, allowing the framework to expand multi protocols, serialization methods, data compression methods, etc.;
42
42
- transport: provides the ability of network transmission, supports transmission methods such as tcp/udp/ssl/unix-socket;
43
-
- runtime: provides the implementation of the framework runtime environment, encapsulates the thread model and io model, supports m:n coroutine (fiber) model, io and handle separation, and model thread model;
43
+
- runtime: provides the implementation of the framework runtime environment, encapsulates the thread model and io model, supports m:n coroutine (fiber) model, io and handle separated and merged thread model;
44
44
- filter: provides the definition of a custom filter, implements the extension capability, such as tracing, metrics, logreplay, etc.;
45
45
46
46
The service governance plugin implementation mainly includes the following modules:
@@ -80,22 +80,22 @@ The request processing generally includes the following processes:
80
80
1. The server transport calls the Acceptor to wait for the client to establish a connection;
81
81
2. The client initiates a connection establishment request, and the server transport Accept returns a tcp connection;
82
82
3. The server transport determines to dispatch the connection according to the current runtime environment (whether it is fiber runtime);
83
-
1. If it is a fiber runtime, then select a fiber scheduling group, which will be processed by the Fiber Reactor on the specific fiber scheduling group;
84
-
2. If not, then select an io thread to be handled by the Reactor of the specific io thread;
85
-
4. Start the logic of receiving packets. The server transport reads the request continuously according to the codec protocol, compression method, and serialization method. Each request will create a msg, which includes the ServerContext of the request, and requests the msg to be handed over to the upper service deal with;
83
+
1. If it is a fiber runtime, then select a fiber scheduling group, of which the Fiber Reactor will processes the connection;
84
+
2. If not, then select an io thread, of which the Reactor will processes the connection;
85
+
4. Start the logic of receiving packets. The server transport reads the request continuously according to the codec protocol, compression method, and serialization method. A msg including the ServerContext of the request will be created for each request, then handle the msg over to upper service for further processing;
86
86
5. The service will find the corresponding registered processing function according to the rpc name of the msg, and call the corresponding processing function;
87
-
6. Before calling the corresponding processing function, the filterchain must be executed first, and the end of the filterchain execution is the processing function of the rpc we registered;
88
-
7. Serialize, compress, encode and decode the result of the response, and then return the packet to the client. The return method is divided into synchronous and asynchronous;
89
-
1. The synchronization method is that after the rpc processing function is executed, the result is directly processed and returned to the client, the default method;
90
-
2. The asynchronous method is that after the rpc processing function is executed, the package is not returned to the client, but the business itself is asynchronously processed, and the package can be returned by actively calling the framework's return package;
87
+
6. Before calling the corresponding processing function, the filterchain must be executed first, and behind the filterchain execution is the processing function of the rpc we registered;
88
+
7. Serialize, compressand encode the result of the response, and then return the packet to the client. The return method is divided into synchronous and asynchronous;
89
+
1. The synchronization method is that after the rpc processing function is executed, the result is directly processed and returned to the client, this is the default method;
90
+
2. The asynchronous method is that after the rpc processing function is executed, the package is not returned to the client, but returned by users by actively calling the framework's interface after asynchronous business logic;
91
91
92
92
### Exit
93
93
94
94
The service exit process generally includes the following processes:
95
95
96
96
1. Wait for all requests received by the server to be processed(To avoid being unable to exit due to waiting, the default maximum waiting time is set to 5 seconds.It can be configured through server::stop_max_wait_time);
97
-
2. Stop the monitoring and reading events of the server network connection;
98
-
3. Close the server network connection;
97
+
2. Stop the listening and reading events of the server network connection;
98
+
3. Close the server network connections;
99
99
4. Call the `Destroy` method of the `TrpcApp` business subclass to stop the dynamic resources created by the business (for example: started threads);
100
100
5. Stop the dynamic resources created by the plugins (for example: threads started inside the plugins);
101
101
6. Stop the framework runtime environment runtime;
@@ -142,5 +142,4 @@ The workflow of the interceptor filter is as follows:
142
142
143
143

144
144
145
-
The ultimate purpose of the interceptor is to allow business logic and framework
146
-
Decoupling and allowing cohesive development of each. You can add or replace different plugin implementations through configuration without modifying the source code.
145
+
The ultimate purpose of the interceptor is to allow business logic and framework decoupled and allow cohesive development of each. You can add or replace different plugin implementations through configuration without modifying the source code.
Copy file name to clipboardExpand all lines: docs/en/backup_request.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# Overview
4
4
5
-
Sometimes, to ensure availability or reduce tail latency, it is necessary to simultaneously access two services and take the response from whichever arrives first. There are generally two approaches to implementing this functionality:
5
+
Sometimes, to ensure availability or reduce tail latency, it is necessary to simultaneously access two services and take the response from whichever arrives first. There are generally two approaches to implement this functionality:
6
6
7
7
1. Concurrently send two requests and take the result from the one that returns first.
8
8
2. Set a reasonable resend time. If a request times out or fails
Copy file name to clipboardExpand all lines: docs/en/basic_tutorial.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,7 +286,7 @@ client:
286
286
287
287
By the configuration, `Forward` service will use target(ip:port) to access the `HelloWorld` service.
288
288
289
-
After setting the options of the ServiceProxy, then creating and using the ServiceProxy to access the helloworld service.
289
+
After setting the options of the ServiceProxy, then create and use the ServiceProxy to access the helloworld service.
290
290
291
291
First, add a constructor to the ForwardServiceServiceImpl class in file `./server/service.h`, and define a GreeterServiceProxy type smart pointer member variable.
292
292
@@ -400,7 +400,7 @@ global:
400
400
handle_thread_num: 6
401
401
```
402
402
403
-
You can choose to merge or separate threadmodel runtime. Here we take the separated threadmodel runtime as an example.
403
+
You can choose to merge or separate threadmodel runtime. Here we take the separate threadmodel runtime as an example.
404
404
405
405
For detailed separate or merge runtime configuration, please refer to [Framework Configuration](framework_config_full.md).
0 commit comments