Debian Codegraph @

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

raw symbols SCIP
1 #ifndef AWS_IO_STATISTICS_H
2 #define AWS_IO_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/io/io.h>
10
11 #include <aws/common/statistics.h>
12 #include <aws/io/tls_channel_handler.h>
13
14 AWS_PUSH_SANE_WARNING_LEVEL
15
16 enum aws_crt_io_statistics_category {
17 AWSCRT_STAT_CAT_SOCKET = AWS_CRT_STATISTICS_CATEGORY_BEGIN_RANGE(AWS_C_IO_PACKAGE_ID),
18 AWSCRT_STAT_CAT_TLS,
19 };
20
21 /**
22 * Socket channel handler statistics record
23 */
24 struct aws_crt_statistics_socket {
25 aws_crt_statistics_category_t category;
26 uint64_t bytes_read;
27 uint64_t bytes_written;
28 };
29
30 /**
31 * Tls channel handler statistics record
32 */
33 struct aws_crt_statistics_tls {
34 aws_crt_statistics_category_t category;
35 uint64_t handshake_start_ns;
36 uint64_t handshake_end_ns;
37 enum aws_tls_negotiation_status handshake_status;
38 };
39
40 AWS_EXTERN_C_BEGIN
41
42 /**
43 * Initializes socket channel handler statistics
44 */
45 AWS_IO_API
46 int aws_crt_statistics_socket_init(struct aws_crt_statistics_socket *stats);
47
48 /**
49 * Cleans up socket channel handler statistics
50 */
51 AWS_IO_API
52 void aws_crt_statistics_socket_cleanup(struct aws_crt_statistics_socket *stats);
53
54 /**
55 * Resets socket channel handler statistics for the next gather interval. Calculate-once results are left alone.
56 */
57 AWS_IO_API
58 void aws_crt_statistics_socket_reset(struct aws_crt_statistics_socket *stats);
59
60 /**
61 * Initializes tls channel handler statistics
62 */
63 AWS_IO_API
64 int aws_crt_statistics_tls_init(struct aws_crt_statistics_tls *stats);
65
66 /**
67 * Cleans up tls channel handler statistics
68 */
69 AWS_IO_API
70 void aws_crt_statistics_tls_cleanup(struct aws_crt_statistics_tls *stats);
71
72 /**
73 * Resets tls channel handler statistics for the next gather interval. Calculate-once results are left alone.
74 */
75 AWS_IO_API
76 void aws_crt_statistics_tls_reset(struct aws_crt_statistics_tls *stats);
77
78 AWS_EXTERN_C_END
79 AWS_POP_SANE_WARNING_LEVEL
80
81 #endif /* AWS_IO_STATISTICS_H */