-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from boostorg/144-implement-connection-usage-…
…information Adds connection usage information.
- Loading branch information
Showing
7 changed files
with
136 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* Copyright (c) 2018-2022 Marcelo Zimbres Silva ([email protected]) | ||
* | ||
* Distributed under the Boost Software License, Version 1.0. (See | ||
* accompanying file LICENSE.txt) | ||
*/ | ||
|
||
#ifndef BOOST_REDIS_USAGE_HPP | ||
#define BOOST_REDIS_USAGE_HPP | ||
|
||
namespace boost::redis | ||
{ | ||
|
||
/** @brief Connection usage information. | ||
* @ingroup high-level-api | ||
* | ||
* @note: To simplify the implementation, the commands_sent and | ||
* bytes_sent in the struct below are computed just before writing to | ||
* the socket, which means on error they might not represent exaclty | ||
* what has been received by the Redis server. | ||
*/ | ||
struct usage { | ||
/// Number of commands sent. | ||
std::size_t commands_sent = 0; | ||
|
||
/// Number of bytes sent. | ||
std::size_t bytes_sent = 0; | ||
|
||
/// Number of responses received. | ||
std::size_t responses_received = 0; | ||
|
||
/// Number of pushes received. | ||
std::size_t pushes_received = 0; | ||
|
||
/// Number of response-bytes received. | ||
std::size_t response_bytes_received = 0; | ||
|
||
/// Number of push-bytes received. | ||
std::size_t push_bytes_received = 0; | ||
}; | ||
|
||
} // boost::redis | ||
|
||
#endif // BOOST_REDIS_USAGE_HPP |
Oops, something went wrong.