Skip to content

Commit

Permalink
feat docs: minor tweaks and updates for changelog
Browse files Browse the repository at this point in the history
Tests: протестировано CI
commit_hash:6b5ba8e4e0d2489999d8b03b06f76331ac04e55f
  • Loading branch information
apolukhin committed Nov 7, 2024
1 parent 4ee4621 commit 20badeb
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
1 change: 1 addition & 0 deletions samples/chaotic_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ target_include_directories(${PROJECT_NAME}_objs PUBLIC src)
# /// [objects]

# /// [chaotic]
# cmake
file(GLOB_RECURSE SCHEMAS ${CMAKE_CURRENT_SOURCE_DIR}/schemas/*.yaml)
userver_target_generate_chaotic(${PROJECT_NAME}-chgen
ARGS
Expand Down
1 change: 1 addition & 0 deletions samples/chaotic_service/schemas/hello.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml
components:
schemas:
HelloRequestBody:
Expand Down
1 change: 1 addition & 0 deletions samples/chaotic_service/schemas/types.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml
components:
schemas:
DateTime:
Expand Down
30 changes: 16 additions & 14 deletions scripts/docs/en/userver/chaotic.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ Number supports the following validators:

String type is mapped to different C++ types:

| format | C++ type |
|-----------------------|------------------------------|
| - | `std::string` |
| `uuid` | `boost::uuids::uuid` |
| `date` | `utils::datetime::Date` |
| `date-time` | `utils::TimePointTz` |
| `date-time-iso-basic` | `utils::TimePointTzIsoBasic` |
| format | C++ type |
|-----------------------|----------------------------------------|
| - | `std::string` |
| `uuid` | `boost::uuids::uuid` |
| `date` | `utils::datetime::Date` |
| `date-time` | `utils::datetime::TimePointTz` |
| `date-time-iso-basic` | `utils::datetime::TimePointTzIsoBasic` |

String supports the following validators:
* `minLength`
Expand Down Expand Up @@ -172,16 +172,17 @@ Required fields of C++ type `T` produce C++ fields with the same type `T`.
Non-required fields of C++ type `T` produce C++ fields with type `std::optional<T>`.

E.g. the following JSONSchema:
```yaml
```
yaml
type: object
additionalProperties: false
properties:
foo:
type: integer
bar:
type: string
foo:
type: integer
bar:
type: string
required:
- foo
- foo
```

produces the following C++ structure:
Expand Down Expand Up @@ -247,7 +248,8 @@ but it can be never `nullptr`.
Example:
```yaml
```
yaml
TreeNode:
type: object
additionalProperties: false
Expand Down
6 changes: 5 additions & 1 deletion scripts/docs/en/userver/roadmap_and_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Changelog news also go to the

* Added S3 API client s3api::Client. More docs to come soon. Many thanks to
[v-for-vandal](https://github.com/v-for-vandal) for the work!
* Added gRPC reflection library. More docs to come soon. Many thanks to
[v-for-vandal](https://github.com/v-for-vandal) for the work!
* @ref scripts/docs/en/userver/congestion_control.md "Congestion Control" turned on by default.
* Initial work towards embedding GDB pretty-printers to userver binaries.
* Mongo now has the full functionality for diagnostics out-of-the box, without mongo-c library patches.
* Simplified contributing by removing the annoying bot that checks for explicit agreement to CLA. Creating an issue or
Expand All @@ -62,7 +65,8 @@ Optimizations:

* Build:
* Added `userver_module()` CMake function to simplify configuration of new drivers that are being added to userver.
* Added missing `fmt/ranges.h` includes. Thanks to [Vasilii Kuziakin](https://github.com/Basiliuss) for the PR!
* Added missing `fmt/ranges.h` includes. Thanks to [Vasilii Kuziakin](https://github.com/Basiliuss) and to
[SidorovichPavel](https://github.com/SidorovichPavel) for the PRs!
* Proper use of `PROTOBUF_PROTOC` in CMake. Thanks to [Nikita](https://github.com/rtkid-nik) for the PR!
* Added support for builds in paths that contain whitespaces and other special symbols.
* Added CI build tests for Ubuntu 24.04 and MacOS.
Expand Down
23 changes: 11 additions & 12 deletions scripts/docs/en/userver/tutorial/production_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ that would stop sending traffic to the server if it responds with codes other th

@snippet samples/production_service/static_config.yaml Production service sample - static config ping

Note that the ping handler lives on the task processor of all the other handlers. Smart balancers may measure response times and send less traffic to the heavy loaded services.
Note that the ping handler lives on the task processor of all the other handlers. Smart balancers may measure response
times and send less traffic to the heavy loaded services.

```
bash
Expand All @@ -129,16 +130,16 @@ Content-Length: 0
```


### Dynamic configs
### Dynamic configs of a sample production service

Here's a configuration of a dynamic config related components
components::DynamicConfigClient, components::DynamicConfig,
components::DynamicConfigClientUpdater.

Service starts with some dynamic config values from `dynamic-config.fs-cache-path`
file and updates dynamic values from a
Service starts with some dynamic config values from defaults and updates dynamic values from a
@ref scripts/docs/en/userver/tutorial/config_service.md "configs service"
at startup.
at startup. If the first update fails, the values are retrieved from `dynamic-config.fs-cache-path`
file (if it exists).

@snippet samples/production_service/static_config.yaml Production service sample - static config dynamic configs

Expand All @@ -154,13 +155,15 @@ at startup.

See @ref scripts/docs/en/userver/congestion_control.md.

congestion_control::Component limits the active requests count. In case of overload it responds with HTTP 429 codes to some requests, allowing your service to properly process handle the rest.
congestion_control::Component limits the active requests count. In case of overload it responds with HTTP 429 codes to
some requests, allowing your service to properly process handle the rest.

All the significant parts of the component are configured by dynamic config options @ref USERVER_RPS_CCONTROL and @ref USERVER_RPS_CCONTROL_ENABLED
All the significant parts of the component are configured by dynamic config options @ref USERVER_RPS_CCONTROL and
@ref USERVER_RPS_CCONTROL_ENABLED.

@snippet samples/production_service/static_config.yaml Production service sample - static config congestion-control

It is a good idea to disable it in unit tests to avoid getting HTTP 429 on an overloaded CI server.
It is a good idea to disable it in unit tests to avoid getting `HTTP 429` on an overloaded CI server.


@anchor tutorial_metrics
Expand Down Expand Up @@ -221,10 +224,6 @@ data. This component is required by many high-level components and it is safe to
use this component in production environments.


## Dynamic config

Dynamic configs are described in details at @ref scripts/docs/en/schemas/dynamic_configs.md .

### Build

This sample requires @ref scripts/docs/en/userver/tutorial/config_service.md "configs service", so we build and start one from our previous tutorials.
Expand Down

0 comments on commit 20badeb

Please sign in to comment.