Debian Codegraph @

crt/aws-c-http/include/aws/http/private/connection_monitor.h

raw symbols SCIP
1 #ifndef AWS_HTTP_HTTP_MONITOR_H
2 #define AWS_HTTP_HTTP_MONITOR_H
3
4 /**
5 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 * SPDX-License-Identifier: Apache-2.0.
7 */
8
9 #include <aws/http/connection.h>
10 #include <aws/http/http.h>
11
12 struct aws_allocator;
13 struct aws_crt_statistics_handler;
14
15 /*
16 * Needed by tests
17 */
18 struct aws_statistics_handler_http_connection_monitor_impl {
19 struct aws_http_connection_monitoring_options options;
20
21 uint64_t throughput_failure_time_ms;
22 uint32_t last_incoming_stream_id;
23 uint32_t last_outgoing_stream_id;
24 uint64_t last_measured_throughput;
25 };
26
27 AWS_EXTERN_C_BEGIN
28
29 /**
30 * Creates a new http connection monitor that regularly checks the connection's throughput and shuts the connection
31 * down if the a minimum threshold is not met for a configurable number of seconds.
32 */
33 AWS_HTTP_API
34 struct aws_crt_statistics_handler *aws_crt_statistics_handler_new_http_connection_monitor(
35 struct aws_allocator *allocator,
36 struct aws_http_connection_monitoring_options *options);
37
38 /**
39 * Validates monitoring options to ensure they are sensible
40 */
41 AWS_HTTP_API
42 bool aws_http_connection_monitoring_options_is_valid(const struct aws_http_connection_monitoring_options *options);
43
44 AWS_EXTERN_C_END
45
46 #endif /* AWS_HTTP_HTTP_MONITOR_H */