Skip to content

Commit 07d2950

Browse files
authored
Docs: optimize english documents (#51)
1 parent b301f77 commit 07d2950

4 files changed

Lines changed: 28 additions & 29 deletions

File tree

docs/en/admin_service.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Overview
44

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.
66

77
This document introduces the usage of the management service, where developers can learn the following topics:
88

@@ -34,13 +34,13 @@ server:
3434
3535
The framework provides a set of built-in management commands that allow users to conveniently view and modify the service status.
3636
37-
## The way to access
37+
## The ways to access
3838
3939
The framework's built-in management commands can be invoked in two ways.
4040
41-
### Access via a web browser
41+
### Access via web browser
4242
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.
4444

4545
![main page](../images/admin_main_page.png)
4646

@@ -53,9 +53,9 @@ The functionality of each module on the homepage is described as follows.
5353
| heap | View the memory usage. |
5454
| logs | View and modify the log level of the framework. |
5555
| 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. |
5757

58-
### Invoke by constructing HTTP requests manually
58+
### Access via constructing HTTP requests manually
5959

6060
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.
6161

@@ -277,7 +277,7 @@ The statistical variables currently provided by the framework are as follows.
277277

278278
#### The way to enable
279279

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.**
281281

282282
Below, we will introduce the ways to enable this feature in Bazel and CMake, respectively.
283283

@@ -298,14 +298,14 @@ Below, we will introduce the ways to enable this feature in Bazel and CMake, res
298298

299299
Using this compilation option will automatically define the "TRPC_ENABLE_PROFILER" macro, but users need to manually link "libtcmalloc_and_profiler".
300300

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:
302302

303303
```sh
304304
# In the .bazelrc file
305305
build --define trpc_enable_profiler_v2=true
306306
```
307307

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:
309309

310310
```bzl
311311
cc_binary(
@@ -320,14 +320,14 @@ Below, we will introduce the ways to enable this feature in Bazel and CMake, res
320320

321321
3. Define the "TRPC_ENABLE_PROFILER" macro and link "tcmalloc_and_profiler" manually.
322322

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:
324324

325325
```sh
326326
# In the .bazelrc file
327327
build --copt='-DTRPC_ENABLE_PROFILER'
328328
```
329329

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:
331331

332332
```bzl
333333
cc_binary(
@@ -342,7 +342,7 @@ Below, we will introduce the ways to enable this feature in Bazel and CMake, res
342342

343343
##### CMake
344344

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.
346346

347347
```cmake
348348
# define "TRPC_ENABLE_PROFILER"
@@ -464,7 +464,7 @@ $ curl http://admin_ip:admin_port/client_detach -X POST -d 'service_name=trpc.ap
464464

465465
# Custom management commands
466466

467-
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/).
468468

469469
Usage:
470470

@@ -494,7 +494,7 @@ Usage:
494494
You can choose to override the `CommandHandle` interface or the `Handle` interface to implement the control logic.
495495

496496
* 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.
498498

499499
Example:
500500

docs/en/architecture_design.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The implementation of framework core mainly includes the following modules:
4040
- 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;
4141
- codec: provides codec-related interfaces, allowing the framework to expand multi protocols, serialization methods, data compression methods, etc.;
4242
- 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;
4444
- filter: provides the definition of a custom filter, implements the extension capability, such as tracing, metrics, logreplay, etc.;
4545

4646
The service governance plugin implementation mainly includes the following modules:
@@ -80,22 +80,22 @@ The request processing generally includes the following processes:
8080
1. The server transport calls the Acceptor to wait for the client to establish a connection;
8181
2. The client initiates a connection establishment request, and the server transport Accept returns a tcp connection;
8282
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;
8686
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, compress and 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;
9191

9292
### Exit
9393

9494
The service exit process generally includes the following processes:
9595

9696
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;
9999
4. Call the `Destroy` method of the `TrpcApp` business subclass to stop the dynamic resources created by the business (for example: started threads);
100100
5. Stop the dynamic resources created by the plugins (for example: threads started inside the plugins);
101101
6. Stop the framework runtime environment runtime;
@@ -142,5 +142,4 @@ The workflow of the interceptor filter is as follows:
142142

143143
![fitler](../images/filter.png)
144144

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.

docs/en/backup_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Overview
44

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:
66

77
1. Concurrently send two requests and take the result from the one that returns first.
88
2. Set a reasonable resend time. If a request times out or fails

docs/en/basic_tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ client:
286286

287287
By the configuration, `Forward` service will use target(ip:port) to access the `HelloWorld` service.
288288

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.
290290

291291
First, add a constructor to the ForwardServiceServiceImpl class in file `./server/service.h`, and define a GreeterServiceProxy type smart pointer member variable.
292292

@@ -400,7 +400,7 @@ global:
400400
handle_thread_num: 6
401401
```
402402

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.
404404

405405
For detailed separate or merge runtime configuration, please refer to [Framework Configuration](framework_config_full.md).
406406

0 commit comments

Comments
 (0)