Debian Codegraph @

crt/aws-c-http/include/aws/http/statistics.h

raw symbols SCIP
1 #ifndef AWS_HTTP_STATISTICS_H
2 #define AWS_HTTP_STATISTICS_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/http.h>
10
11 #include <aws/common/statistics.h>
12
13 AWS_PUSH_SANE_WARNING_LEVEL
14
15 enum aws_crt_http_statistics_category {
16 AWSCRT_STAT_CAT_HTTP1_CHANNEL = AWS_CRT_STATISTICS_CATEGORY_BEGIN_RANGE(AWS_C_HTTP_PACKAGE_ID),
17 AWSCRT_STAT_CAT_HTTP2_CHANNEL,
18 };
19
20 /**
21 * A statistics struct for http handlers. Tracks the actual amount of time that incoming and outgoing requests are
22 * waiting for their IO to complete.
23 */
24 struct aws_crt_statistics_http1_channel {
25 aws_crt_statistics_category_t category;
26
27 uint64_t pending_outgoing_stream_ms;
28 uint64_t pending_incoming_stream_ms;
29
30 uint32_t current_outgoing_stream_id;
31 uint32_t current_incoming_stream_id;
32 };
33
34 struct aws_crt_statistics_http2_channel {
35 aws_crt_statistics_category_t category;
36
37 uint64_t pending_outgoing_stream_ms;
38 uint64_t pending_incoming_stream_ms;
39
40 /* True if during the time of report, there has ever been no active streams on the connection */
41 bool was_inactive;
42 };
43
44 AWS_EXTERN_C_BEGIN
45
46 /**
47 * Initializes a http channel handler statistics struct
48 */
49 AWS_HTTP_API
50 int aws_crt_statistics_http1_channel_init(struct aws_crt_statistics_http1_channel *stats);
51
52 /**
53 * Cleans up a http channel handler statistics struct
54 */
55 AWS_HTTP_API
56 void aws_crt_statistics_http1_channel_cleanup(struct aws_crt_statistics_http1_channel *stats);
57
58 /**
59 * Resets a http channel handler statistics struct's statistics
60 */
61 AWS_HTTP_API
62 void aws_crt_statistics_http1_channel_reset(struct aws_crt_statistics_http1_channel *stats);
63
64 /**
65 * Initializes a HTTP/2 channel handler statistics struct
66 */
67 AWS_HTTP_API
68 void aws_crt_statistics_http2_channel_init(struct aws_crt_statistics_http2_channel *stats);
69 /**
70 * Resets a HTTP/2 channel handler statistics struct's statistics
71 */
72 AWS_HTTP_API
73 void aws_crt_statistics_http2_channel_reset(struct aws_crt_statistics_http2_channel *stats);
74
75 AWS_EXTERN_C_END
76 AWS_POP_SANE_WARNING_LEVEL
77
78 #endif /* AWS_HTTP_STATISTICS_H */