Skip to content

Commit 7f4e169

Browse files
committed
feat docs: add explicit references to seome entities and update S3API tier
Some of the missing `@ref` were added via `find . -type f | xargs sed -i 's/\([^f#@ ]\) \([a-rtv-z]*\)::/\1 @ref \2::/g` script Tests: протестировано локально commit_hash:87fafd9f53204f5173dcc103d6ec1089957900c2
1 parent f6bbcab commit 7f4e169

File tree

18 files changed

+111
-123
lines changed

18 files changed

+111
-123
lines changed

samples/chaotic_openapi_service/testsuite/test_hello.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ async def call(service_client):
1010

1111

1212
async def test_hello_base(service_client, mockserver, dynamic_config):
13+
# /// [Functional test]
1314
@mockserver.handler('test/test')
1415
def test(request):
1516
assert request.query['name'] == 'john'
1617
return mockserver.make_response('"tost"')
18+
# /// [Functional test]
1719

1820
p = await call(service_client)
1921
assert p['http.request.max_resend_count'] == '1'

scripts/docs/en/userver/cache_dumps.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ and skips the synchronous `Update`.
88
Advantages:
99
- Faster service start: the service no longer waits for the first synchronous
1010
`Update` that may query a database or make some other network requests.
11-
- Better fault tolerance: the service now boots successfully even if the first
12-
update fails.
11+
- Better fault tolerance: the service now boots successfully even if the first update fails.
1312

1413
Disadvantages:
15-
- CPU time is spent on periodic serialization of data and writing to the dump
16-
file.
14+
- CPU time is spent on periodic serialization of data and writing to the dump file.
1715
- Disk accesses consume the IO quota, which can negatively affect other disk
1816
users (for example, logging or other caches).
1917

@@ -56,8 +54,7 @@ In order for a data type to be serialized for cache dumps the `Write` and
5654
* Integers, floats, doubles, strings, `std::chrono`, `enum`, `uuid` in
5755
`<userver/dump/common.hpp>`
5856
* C++ Standard Library and Boost containers, `std::optional`,
59-
`utils::StrongTypedef`, `std::{unique,shared}_ptr` in
60-
`<userver/dump/common_containers.hpp>`
57+
`utils::StrongTypedef`, `std::{unique,shared}_ptr` in `<userver/dump/common_containers.hpp>`
6158
* Protobuf messages in `<userver/dump/protobuf.hpp>`
6259
* Trivial structures (aggregates) in `<userver/dump/aggregates.hpp>`, but
6360
you will have to enable dumps manually:

scripts/docs/en/userver/caches.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ in the background and do not block users from working with the cache.
1111
As a result, the user usually works with slightly outdated data, but at the same
1212
time always has an instant access to some version of the data.
1313

14-
Caches usually inherit from components::CachingComponentBase or
15-
cache::LruCacheComponent. Sections below describe the features of
16-
components::CachingComponentBase. For information on cache::LruCacheComponent
14+
Caches usually inherit from @ref components::CachingComponentBase or
15+
@ref cache::LruCacheComponent. Sections below describe the features of
16+
@ref components::CachingComponentBase. For information on @ref cache::LruCacheComponent
1717
refer to @ref scripts/docs/en/userver/lru_cache.md.
1818

1919

2020
## Update Modes
2121

2222
Caches have two update modes:
23-
* Full update. In this mode, the cache requests its full state from an external
24-
resource.
23+
* Full update. In this mode, the cache requests its full state from an external resource.
2524
* Incremental update. In this mode, the cache requests changes since the last
2625
Full update, patching its current state.
2726

@@ -59,8 +58,7 @@ yaml
5958
`update-interval` is the time interval between the `Update` calls.
6059
In particular this means:
6160
- `Update` is not called concurrently
62-
- Only with `update-jitter: 0s` and `is-strong-period: true` updates follow a
63-
strict schedule.
61+
- Only with `update-jitter: 0s` and `is-strong-period: true` updates follow a strict schedule.
6462

6563
`full-update-interval` is the minimum interval between `full` updates in
6664
`full-and-incremental` cache. With each update, the cache checks if
@@ -159,16 +157,16 @@ cluster increases, which is why the consumed by caches CPU fraction increases.
159157
**The second option**. Add context switching. If you call
160158
engine::Yield() every 1-2ms, then the framework engine has time to execute the
161159
other ready for execution coroutines and the queue of ready coroutines does not
162-
grow to undesirable values. To simplify working with engine::Yield, it is
163-
recommended to use utils::CpuRelax rather than calling engine::Yield() manually.
160+
grow to undesirable values. To simplify working with @ref engine::Yield, it is
161+
recommended to use utils::CpuRelax rather than calling @ref engine::Yield() manually.
164162

165163
## Specializations for DB
166164

167165
Caches over DB are caching components that use a trait structure as a
168166
template argument for customization. Such components are:
169167

170-
- components::MongoCache
171-
- components::PostgreCache
168+
- @ref components::MongoCache
169+
- @ref components::PostgreCache
172170

173171
A typical case of cache usage consists of trait structure definition:
174172

@@ -183,7 +181,7 @@ The DB caches are simple to use and quite poverfull.
183181
## Writing a cache
184182

185183
To write your own cache using only the components::CachingComponentBase base
186-
class, you need to override the cache::CacheUpdateTrait::Update,
184+
class, you need to override the @ref cache::CacheUpdateTrait::Update,
187185
implement Full and Incremental updates. In Update(), don't forget to put down
188186
metrics for the `stats_scope` object, describing how many objects were read,
189187
how many parsing errors there were, and how many elements are in the final cache.

scripts/docs/en/userver/component_system.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ class ComponentA: components::ComponentBase {
7272
```
7373
7474
Only components should know about components. Clients and other types
75-
constructed by components should not use components::ComponentConfig,
76-
components::ComponentContext, or components directly. All the components
77-
should inherit from components::ComponentBase base class and may
75+
constructed by components should not use @ref components::ComponentConfig,
76+
@ref components::ComponentContext, or components directly. All the components
77+
should inherit from @ref components::ComponentBase base class and may
7878
override its methods.
7979
8080
All the components are listed at the @ref userver_components API Group.
8181
8282
## Startup context
83-
On component construction a components::ComponentContext is passed as a
83+
On component construction a @ref components::ComponentContext is passed as a
8484
second parameter to the constructor of the component. That context could
8585
be used to get references to other components. That reference to the
8686
component is guaranteed to outlive the component that is being constructed.
@@ -89,32 +89,30 @@ component is guaranteed to outlive the component that is being constructed.
8989
Please see docs on @ref components::ServiceLifetimeStage.
9090
9191
## Components construction and destruction order
92-
utils::DaemonMain, components::Run or components::RunOnce
93-
start all the components from the passed components::ComponentList.
94-
Each component is constructed in a separate engine::Task on the default
92+
@ref utils::DaemonMain, @ref components::Run or @ref components::RunOnce
93+
start all the components from the passed @ref components::ComponentList.
94+
Each component is constructed in a separate @ref engine::Task on the default
9595
task processor and is initialized concurrently with other components.
9696
9797
This is a useful feature, for example in cases
9898
with multiple caches that slowly read from different databases.
9999
100100
To make component *A* depend on component *B* just call
101-
components::ComponentContext::FindComponent<B>() in the constructor of A.
101+
@ref components::ComponentContext::FindComponent<B>() in the constructor of A.
102102
FindComponent() suspends the current task and continues only after the
103103
construction of component B is finished. Components are destroyed
104104
in reverse order of construction, so the component A is destroyed before
105105
the component B. In other words - references from FindComponent() outlive
106106
the component that called the FindComponent() function. If any component
107107
loading fails, FindComponent() wakes up and throws an
108-
components::ComponentsLoadCancelledException.
108+
@ref components::ComponentsLoadCancelledException.
109109
110110
@anchor clients_from_components_lifetime
111111
## References from components and lifetime of clients
112-
It is a common practice to have a component that returns a reference *R* from
113-
some function *F*. In such cases:
112+
It is a common practice to have a component that returns a reference *R* from some function *F*. In such cases:
114113
* a reference *R* lives as long as the component is alive
115114
* a reference *R* is usually a client
116-
* and it is safe to invoke member functions of reference *R* concurrently
117-
unless otherwise specified.
115+
* and it is safe to invoke member functions of reference *R* concurrently unless otherwise specified.
118116
119117
Examples:
120118
* components::HttpClient::GetHttpClient()
@@ -123,17 +121,17 @@ Examples:
123121
## Components static configuration
124122
components::ManagerControllerComponent configures the engine internals from
125123
information provided in its static config: preallocates coroutines, creates
126-
the engine::TaskProcessor, creates threads for low-level event processing.
124+
the @ref engine::TaskProcessor, creates threads for low-level event processing.
127125
After that it starts all the components that
128126
were added to the components::ComponentList. Each registered component
129127
should have a section in service config (also known as static config).
130128
131129
The component configuration is passed as a first parameter of type
132-
components::ComponentConfig to the constructor of the component. Note that
133-
components::ComponentConfig extends the functionality of
134-
yaml_config::YamlConfig with YamlConfig::Mode::kEnvAllowed mode
130+
@ref components::ComponentConfig to the constructor of the component. Note that
131+
@ref components::ComponentConfig extends the functionality of
132+
@ref yaml_config::YamlConfig with @ref YamlConfig::Mode::kEnvAllowed mode
135133
that is able to substitute variables with values, use environment variales and
136-
fallbacks. See yaml_config::YamlConfig for more info and examples.
134+
fallbacks. See @ref yaml_config::YamlConfig for more info and examples.
137135
138136
All the components have the following options:
139137
@@ -197,13 +195,12 @@ the component.
197195
You need a component if:
198196
* you need a static config
199197
* you need to work with other components
200-
* you are writing clients (you need a component to be the factory for your
201-
clients)
198+
* you are writing clients (you need a component to be the factory for your clients)
202199
* you want to subscribe for configs or cache changes
203200
204201
### HowTo
205202
Start writing your component from adding a header file with a class
206-
inherited from components::ComponentBase.
203+
inherited from @ref components::ComponentBase.
207204
@snippet components/component_sample_test.hpp Sample user component header
208205
209206
In source file write the implementation of the component:
@@ -218,9 +215,9 @@ If you need dynamic configs, you can get them using this approach:
218215
@note See @ref scripts/docs/en/userver/tutorial/config_service.md for info on how to
219216
implement your own config server.
220217
221-
Do not forget to register your component in components::ComponentList
222-
before invoking the utils::DaemonMain, components::Run or
223-
components::RunOnce.
218+
Do not forget to register your component in @ref components::ComponentList
219+
before invoking the @ref utils::DaemonMain, @ref components::Run or
220+
@ref components::RunOnce.
224221
225222
Done! You've implemented your first component. Full sources:
226223
* @ref components/component_sample_test.hpp

scripts/docs/en/userver/deadline_propagation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ support deadline propagation.
140140
### Blocking the deadline propagation
141141

142142
Task-inherited deadline is by default propagated from the handler task to child tasks created via `utils::*Async*`.
143-
There it is used in all clients that support it. This is implemented via `server::request::kTaskInheritedData`
144-
and `server::request::GetTaskInheritedDeadline`.
143+
There it is used in all clients that support it. This is implemented via @ref server::request::kTaskInheritedData
144+
and @ref server::request::GetTaskInheritedDeadline.
145145

146146
In _background tasks_ that are started from the task of the request, but do not affect its completion, the deadline
147147
should not be propagated from the request tasks. Blocking such deadline propagation can be achieved by the following
148148
mechanisms:
149149

150-
- `concurrent::BackgroundTaskStorage::AsyncDetach`
151-
- `utils::AsyncBackground`
152-
- `engine::AsyncNoSpan` (don't use it if you are not sure that you need it!)
150+
- @ref concurrent::BackgroundTaskStorage::AsyncDetach()
151+
- @ref utils::AsyncBackground
152+
- @ref engine::AsyncNoSpan (don't use it if you are not sure that you need it!)
153153

154154
@warning when creating background tasks via `utils::Async` (instead of `utils::AsyncBackground`), requests performed
155155
in them will be interrupted along with the parent task**
@@ -181,7 +181,7 @@ Metrics:
181181
* `cancelled-by-deadline` (monotonic counter) - counts requests the handling of which was cancelled by deadline
182182
(deadline expired by the end of handling, or some operation estimated that the deadline would surely expire).
183183

184-
Log tags of the request's `tracing::Span`:
184+
Log tags of the request's @ref tracing::Span :
185185

186186
* `deadline_received_ms=...` if the calling service has set a deadline for the request
187187
* if deadline expired while handling the request:

scripts/docs/en/userver/development/releases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ snapshots of the `develop` sources with
4040
Releases do not evolve, all the new functionality and bugfixes go to
4141
develop branch of git to become a new release some day.
4242

43-
Starting from userver 2.0 we do a new minor release monthly.
43+
Starting from userver 2.0 we do a new minor release once in a month or two.
4444

4545

4646
## Issue, feature and pull requests (PR)

scripts/docs/en/userver/development/stability.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ less popular.
6060

6161
There are tiers to differentiate technologies:
6262

63-
* **Platinum Tier** - driver is known to be used in multiple high load critical
64-
to uptime services in huge companies.
65-
* **Golden Tier** - driver that has not enough usage
66-
feedback from huge companies. Still fine for production usage.
63+
* **Platinum Tier** - driver is known to be used in multiple high load critical to uptime services in huge companies.
64+
* **Golden Tier** - driver that has not enough usage feedback from huge companies. Still fine for production usage.
6765
* **Silver Tier** - early days of the driver. It passes all the tests and works
6866
fine, but more feedback/time required to become a Golden Tier driver. Fine
6967
for prototyping and production usage with some caution.

scripts/docs/en/userver/driver_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ in userver.
4242
Otherwise, if the native driver is written in C++ and is not too big, then
4343
it may be possible to patch it to use userver IO primitives
4444
(engine::io::Socket, for example) and cleaning out other blocking primitives
45-
in favor of userver ones (engine::Mutex, engine::ConditionVariable). This
45+
in favor of userver ones (engine::Mutex, @ref engine::ConditionVariable). This
4646
approach was used to write the Clickhouse driver in userver.
4747
4848
In both approaches there is a downside. The native library must be integrated
@@ -56,7 +56,7 @@ Implement the protocol yourself (probably reusing a subset of the native
5656
library functionality). This approach was used to write the PostgreSQL driver
5757
in userver - it creates a
5858
connection in a separate `TaskProcessor` via native functions, and then
59-
subscribes to the socket via engine::io::Socket, parses the protocol in the
59+
subscribes to the socket via @ref engine::io::Socket, parses the protocol in the
6060
main `TaskProcessor`.
6161
6262
Such an approach may open the door for further optimizations. If no native

scripts/docs/en/userver/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Otherwise, there could be enough information to reproduce the problem.
5151
a `noexcept` function. See the trace for the place where that happened and add
5252
`try`+`catch` block in your sources, to catch and print the exception that
5353
is thrown.
54-
* Take a closer look at the utils::Async and engine::AsyncNoSpan usage in
54+
* Take a closer look at the utils::Async and @ref engine::AsyncNoSpan usage in
5555
your code. Captured by reference variables in lambdas should outlive the
5656
returned task.
5757

scripts/docs/en/userver/grpc/grpc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See also:
1919
* Creating asynchronous gRPC clients and services;
2020
* Forwarding gRPC Core logs to userver logs;
2121
* Caching and reusing connections;
22-
* @ref scripts/docs/en/userver/grpc/grpc_retries.md;
22+
* @ref scripts/docs/en/userver/grpc/timeouts_retries.md;
2323
* Collection of metrics on driver usage;
2424
* Cancellation support;
2525
* Automatic authentication using middlewares;
@@ -53,7 +53,7 @@ In a component constructor, find @ref ugrpc::client::ClientFactoryComponent and
5353

5454
Client creation in an expensive operation! Either create them once at the server boot time or cache them. An automated
5555
solution for client creation and caching is the @ref ugrpc::client::SimpleClientComponent. It also allows to
56-
specify dynamic config for @ref ugrpc::client::ClientQos:
56+
specify dynamic config for @ref ugrpc::client::ClientQos :
5757

5858
@snippet samples/grpc_service/src/greeter_client.hpp component
5959

0 commit comments

Comments
 (0)