usage.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Copyright (c) 2018-2023 Marcelo Zimbres Silva (mzimbres@gmail.com)
  2. *
  3. * Distributed under the Boost Software License, Version 1.0. (See
  4. * accompanying file LICENSE.txt)
  5. */
  6. #ifndef BOOST_REDIS_USAGE_HPP
  7. #define BOOST_REDIS_USAGE_HPP
  8. namespace boost::redis
  9. {
  10. /** @brief Connection usage information.
  11. * @ingroup high-level-api
  12. *
  13. * @note: To simplify the implementation, the commands_sent and
  14. * bytes_sent in the struct below are computed just before writing to
  15. * the socket, which means on error they might not represent exaclty
  16. * what has been received by the Redis server.
  17. */
  18. struct usage {
  19. /// Number of commands sent.
  20. std::size_t commands_sent = 0;
  21. /// Number of bytes sent.
  22. std::size_t bytes_sent = 0;
  23. /// Number of responses received.
  24. std::size_t responses_received = 0;
  25. /// Number of pushes received.
  26. std::size_t pushes_received = 0;
  27. /// Number of response-bytes received.
  28. std::size_t response_bytes_received = 0;
  29. /// Number of push-bytes received.
  30. std::size_t push_bytes_received = 0;
  31. };
  32. } // boost::redis
  33. #endif // BOOST_REDIS_USAGE_HPP