Skip to content

feat: implement rate rlimiter#727

Open
helintongh wants to merge 3 commits intoqicosmos:masterfrom
helintongh:feature_add_rlimiter
Open

feat: implement rate rlimiter#727
helintongh wants to merge 3 commits intoqicosmos:masterfrom
helintongh:feature_add_rlimiter

Conversation

@helintongh
Copy link
Collaborator

No description provided.

@helintongh helintongh requested a review from qicosmos February 11, 2026 11:20
This was referenced Feb 11, 2026
@github-actions
Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                        117                 0   100.00%        1793               156    91.30%         552               102    81.52%
coro_http_connection.hpp                     46                 2    95.65%         788                66    91.62%         230                37    83.91%
coro_http_request.hpp                        30                 0   100.00%         220                 4    98.18%          86                 7    91.86%
coro_http_response.hpp                       32                 1    96.88%         284                17    94.01%         114                17    85.09%
coro_http_router.hpp                         15                 0   100.00%         182                18    90.11%          22                 7    68.18%
coro_http_server.hpp                         56                 1    98.21%        1014               107    89.45%         200                54    73.00%
coro_radix_tree.hpp                          17                 0   100.00%         264                38    85.61%         136                28    79.41%
define.h                                      3                 0   100.00%          36                 2    94.44%          20                 1    95.00%
gzip.hpp                                      6                 2    66.67%         200                99    50.50%          52                28    46.15%
http_parser.hpp                              29                 1    96.55%         185                13    92.97%          52                 5    90.38%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          88                15    82.95%          22                 5    77.27%
picohttpparser.h                             13                 5    61.54%         431               236    45.24%         212                95    55.19%
response_cv.hpp                               2                 0   100.00%          55                24    56.36%          46                12    73.91%
session.hpp                                  12                 0   100.00%          55                 2    96.36%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                20                 7    65.00%         172                70    59.30%          28                 2    92.86%
uri.hpp                                      16                 0   100.00%         174                 0   100.00%         168                25    85.12%
url_encode_decode.hpp                         4                 0   100.00%          93                28    69.89%          48                16    66.67%
utils.hpp                                    16                 0   100.00%         279                28    89.96%         160                58    63.75%
websocket.hpp                                15                 4    73.33%         181                43    76.24%          78                17    78.21%
ylt/coro_io/client_pool.hpp                  21                 5    76.19%         278               132    52.52%          56                37    33.93%
ylt/coro_io/coro_file.hpp                    34                 0   100.00%         246                20    91.87%          44                18    59.09%
ylt/coro_io/coro_io.hpp                      61                 6    90.16%         407                44    89.19%          32                 9    71.88%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              40                 8    80.00%         227                41    81.94%          28                 8    71.43%
ylt/coro_io/load_blancer.hpp                 16                 1    93.75%         112                 5    95.54%          34                 7    79.41%
ylt/metric/counter.hpp                       22                 0   100.00%         178                 4    97.75%          52                 3    94.23%
ylt/metric/dynamic_metric.hpp                15                 0   100.00%          71                 0   100.00%          12                 0   100.00%
ylt/metric/gauge.hpp                          5                 0   100.00%          18                 0   100.00%           2                 0   100.00%
ylt/metric/histogram.hpp                     15                 0   100.00%         137                 0   100.00%          28                 1    96.43%
ylt/metric/metric.hpp                        27                 0   100.00%          98                 0   100.00%          18                 1    94.44%
ylt/metric/metric_manager.hpp                58                 1    98.28%         413                16    96.13%         100                 9    91.00%
ylt/metric/summary.hpp                       12                 0   100.00%          93                 0   100.00%          18                 0   100.00%
ylt/metric/summary_impl.hpp                  23                 2    91.30%         276                40    85.51%          96                25    73.96%
ylt/metric/system_metric.hpp                 14                 0   100.00%         270                18    93.33%          20                 9    55.00%
ylt/metric/thread_local_value.hpp            12                 0   100.00%          74                 4    94.59%          16                 2    87.50%
ylt/util/concurrentqueue.h                   77                26    66.23%        1236               717    41.99%         290               198    31.72%
ylt/util/expected.hpp                        11                 4    63.64%          11                 4    63.64%           0                 0         -
ylt/util/map_sharded.hpp                     24                 0   100.00%         168                 5    97.02%          38                 6    84.21%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       994                85    91.45%       11220              2057    81.67%        3178               861    72.91%

@github-actions
Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                        117                 0   100.00%        1793               156    91.30%         552               102    81.52%
coro_http_connection.hpp                     46                 2    95.65%         788                66    91.62%         230                35    84.78%
coro_http_request.hpp                        30                 0   100.00%         220                 4    98.18%          86                 7    91.86%
coro_http_response.hpp                       32                 1    96.88%         284                17    94.01%         114                17    85.09%
coro_http_router.hpp                         15                 0   100.00%         182                18    90.11%          22                 7    68.18%
coro_http_server.hpp                         56                 1    98.21%        1014               110    89.15%         200                55    72.50%
coro_radix_tree.hpp                          17                 0   100.00%         264                38    85.61%         136                28    79.41%
define.h                                      3                 0   100.00%          36                 2    94.44%          20                 1    95.00%
gzip.hpp                                      6                 2    66.67%         200                99    50.50%          52                28    46.15%
http_parser.hpp                              29                 1    96.55%         185                13    92.97%          52                 5    90.38%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          88                15    82.95%          22                 5    77.27%
picohttpparser.h                             13                 5    61.54%         431               236    45.24%         212                95    55.19%
response_cv.hpp                               2                 0   100.00%          55                24    56.36%          46                12    73.91%
session.hpp                                  12                 0   100.00%          55                 2    96.36%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                20                 7    65.00%         172                70    59.30%          28                 2    92.86%
uri.hpp                                      16                 0   100.00%         174                 0   100.00%         168                25    85.12%
url_encode_decode.hpp                         4                 0   100.00%          93                28    69.89%          48                16    66.67%
utils.hpp                                    16                 0   100.00%         279                28    89.96%         160                58    63.75%
websocket.hpp                                15                 4    73.33%         181                43    76.24%          78                17    78.21%
ylt/coro_io/client_pool.hpp                  21                 5    76.19%         278               132    52.52%          56                37    33.93%
ylt/coro_io/coro_file.hpp                    34                 0   100.00%         246                20    91.87%          44                18    59.09%
ylt/coro_io/coro_io.hpp                      61                 6    90.16%         407                44    89.19%          32                 9    71.88%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              40                 8    80.00%         227                41    81.94%          28                 8    71.43%
ylt/coro_io/load_blancer.hpp                 16                 1    93.75%         112                 5    95.54%          34                 7    79.41%
ylt/metric/counter.hpp                       22                 0   100.00%         178                 4    97.75%          52                 3    94.23%
ylt/metric/dynamic_metric.hpp                15                 0   100.00%          71                 0   100.00%          12                 0   100.00%
ylt/metric/gauge.hpp                          5                 0   100.00%          18                 0   100.00%           2                 0   100.00%
ylt/metric/histogram.hpp                     15                 0   100.00%         137                 0   100.00%          28                 1    96.43%
ylt/metric/metric.hpp                        27                 0   100.00%          98                 0   100.00%          18                 1    94.44%
ylt/metric/metric_manager.hpp                58                 1    98.28%         413                16    96.13%         100                 9    91.00%
ylt/metric/summary.hpp                       12                 0   100.00%          93                 0   100.00%          18                 0   100.00%
ylt/metric/summary_impl.hpp                  23                 2    91.30%         276                40    85.51%          96                25    73.96%
ylt/metric/system_metric.hpp                 14                 0   100.00%         270                18    93.33%          20                 9    55.00%
ylt/metric/thread_local_value.hpp            12                 0   100.00%          74                 4    94.59%          16                 2    87.50%
ylt/util/concurrentqueue.h                   77                26    66.23%        1236               713    42.31%         290               196    32.41%
ylt/util/expected.hpp                        11                 4    63.64%          11                 4    63.64%           0                 0         -
ylt/util/map_sharded.hpp                     24                 0   100.00%         168                 5    97.02%          38                 6    84.21%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       994                85    91.45%       11220              2056    81.68%        3178               858    73.00%

@github-actions
Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                              Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cinatra_log_wrapper.hpp                       4                 1    75.00%           9                 1    88.89%           0                 0         -
cookie.hpp                                   15                 2    86.67%          84                 2    97.62%          28                 3    89.29%
coro_http_client.hpp                        117                 0   100.00%        1793               156    91.30%         552               102    81.52%
coro_http_connection.hpp                     46                 2    95.65%         788                66    91.62%         230                36    84.35%
coro_http_request.hpp                        30                 0   100.00%         220                 4    98.18%          86                 7    91.86%
coro_http_response.hpp                       32                 1    96.88%         284                17    94.01%         114                17    85.09%
coro_http_router.hpp                         15                 0   100.00%         182                18    90.11%          22                 7    68.18%
coro_http_server.hpp                         56                 1    98.21%        1014               107    89.45%         200                54    73.00%
coro_radix_tree.hpp                          17                 0   100.00%         264                38    85.61%         136                28    79.41%
define.h                                      3                 0   100.00%          36                 2    94.44%          20                 1    95.00%
gzip.hpp                                      6                 2    66.67%         200                99    50.50%          52                28    46.15%
http_parser.hpp                              29                 1    96.55%         185                13    92.97%          52                 5    90.38%
mime_types.hpp                                1                 0   100.00%           7                 2    71.43%           2                 1    50.00%
multipart.hpp                                 4                 0   100.00%          88                19    78.41%          22                 6    72.73%
picohttpparser.h                             13                 5    61.54%         431               236    45.24%         212                95    55.19%
response_cv.hpp                               2                 0   100.00%          55                24    56.36%          46                12    73.91%
session.hpp                                  12                 0   100.00%          55                 2    96.36%           4                 1    75.00%
session_manager.hpp                          10                 1    90.00%          67                 5    92.54%          10                 1    90.00%
sha1.hpp                                     12                 0   100.00%         181                 8    95.58%          12                 2    83.33%
string_resize.hpp                             2                 0   100.00%          18                 0   100.00%           2                 0   100.00%
time_util.hpp                                20                 7    65.00%         172                72    58.14%          28                 3    89.29%
uri.hpp                                      16                 0   100.00%         174                 0   100.00%         168                25    85.12%
url_encode_decode.hpp                         4                 0   100.00%          93                28    69.89%          48                16    66.67%
utils.hpp                                    16                 0   100.00%         279                28    89.96%         160                58    63.75%
websocket.hpp                                15                 4    73.33%         181                43    76.24%          78                17    78.21%
ylt/coro_io/client_pool.hpp                  21                 5    76.19%         278               132    52.52%          56                37    33.93%
ylt/coro_io/coro_file.hpp                    34                 0   100.00%         246                20    91.87%          44                18    59.09%
ylt/coro_io/coro_io.hpp                      61                 6    90.16%         407                44    89.19%          32                 9    71.88%
ylt/coro_io/detail/client_queue.hpp          10                 5    50.00%          47                23    51.06%          10                 4    60.00%
ylt/coro_io/io_context_pool.hpp              40                 8    80.00%         227                41    81.94%          28                 8    71.43%
ylt/coro_io/load_blancer.hpp                 16                 1    93.75%         112                 5    95.54%          34                 7    79.41%
ylt/metric/counter.hpp                       22                 0   100.00%         178                 4    97.75%          52                 3    94.23%
ylt/metric/dynamic_metric.hpp                15                 0   100.00%          71                 0   100.00%          12                 0   100.00%
ylt/metric/gauge.hpp                          5                 0   100.00%          18                 0   100.00%           2                 0   100.00%
ylt/metric/histogram.hpp                     15                 0   100.00%         137                 0   100.00%          28                 1    96.43%
ylt/metric/metric.hpp                        27                 0   100.00%          98                 0   100.00%          18                 1    94.44%
ylt/metric/metric_manager.hpp                58                 1    98.28%         413                16    96.13%         100                 9    91.00%
ylt/metric/summary.hpp                       12                 0   100.00%          93                 0   100.00%          18                 0   100.00%
ylt/metric/summary_impl.hpp                  23                 2    91.30%         276                40    85.51%          96                25    73.96%
ylt/metric/system_metric.hpp                 14                 0   100.00%         270                18    93.33%          20                 9    55.00%
ylt/metric/thread_local_value.hpp            12                 0   100.00%          74                 4    94.59%          16                 2    87.50%
ylt/util/concurrentqueue.h                   77                26    66.23%        1236               717    41.99%         290               198    31.72%
ylt/util/expected.hpp                        11                 4    63.64%          11                 4    63.64%           0                 0         -
ylt/util/map_sharded.hpp                     24                 0   100.00%         168                 5    97.02%          38                 6    84.21%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                       994                85    91.45%       11220              2063    81.61%        3178               862    72.88%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments