Statistics.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. namespace BestHTTP.Statistics
  3. {
  4. [Flags]
  5. public enum StatisticsQueryFlags : byte
  6. {
  7. /// <summary>
  8. /// Connection based statistics will be returned as the result of the query.
  9. /// </summary>
  10. Connections = 0x01,
  11. /// <summary>
  12. /// Caching based statistics will be returned as the result of the query.
  13. /// </summary>
  14. Cache = 0x02,
  15. /// <summary>
  16. /// Cookie based statistics will be returned as the result of the query.
  17. /// </summary>
  18. Cookies = 0x04,
  19. /// <summary>
  20. /// All statistics will be returned as the result of the query.
  21. /// </summary>
  22. All = 0xFF,
  23. }
  24. public struct GeneralStatistics
  25. {
  26. public StatisticsQueryFlags QueryFlags;
  27. #region Connection Statistics
  28. /// <summary>
  29. /// Number of HTTPConnection instances
  30. /// </summary>
  31. public int Connections;
  32. /// <summary>
  33. /// Number of active connections. These connections are currently processing a request.
  34. /// </summary>
  35. public int ActiveConnections;
  36. /// <summary>
  37. /// Number of free connections. These connections are finished with there requests and waiting for another request or to recycle.
  38. /// </summary>
  39. public int FreeConnections;
  40. /// <summary>
  41. /// Number of recycled connections. These connections will be removed as soon as possible.
  42. /// </summary>
  43. public int RecycledConnections;
  44. /// <summary>
  45. /// Number of requests that are waiting in the queue for a free connection.
  46. /// </summary>
  47. public int RequestsInQueue;
  48. #endregion
  49. #region Cache Statistics
  50. /// <summary>
  51. /// Number of cached responses.
  52. /// </summary>
  53. public int CacheEntityCount;
  54. /// <summary>
  55. /// Sum size of the cached responses in bytes.
  56. /// </summary>
  57. public ulong CacheSize;
  58. #endregion
  59. #region Cookie Statistics
  60. /// <summary>
  61. /// Number of cookies in the Cookie Jar.
  62. /// </summary>
  63. public int CookieCount;
  64. /// <summary>
  65. /// Sum size of the stored cookies in bytes.
  66. /// </summary>
  67. public uint CookieJarSize;
  68. #endregion
  69. }
  70. }