Histogram.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * Copyright (C) Alibaba Cloud Computing
  4. * All rights reserved
  5. */
  6. /**
  7. * The class used to present the result of log histogram status. For every log
  8. * histogram, it contains : from/to time range, hit log count and query
  9. * completed status.
  10. *
  11. * @author log service dev
  12. */
  13. class Aliyun_Log_Models_Histogram {
  14. /**
  15. * @var integer the begin time
  16. */
  17. private $from;
  18. /**
  19. * @var integer the end time
  20. */
  21. private $to;
  22. /**
  23. * @var integer log count of histogram that query hits
  24. */
  25. private $count;
  26. /**
  27. * @var string histogram query status(Complete or InComplete)
  28. */
  29. private $progress;
  30. /**
  31. * Aliyun_Log_Models_Histogram constructor
  32. *
  33. * @param integer $from
  34. * the begin time
  35. * @param integer $to
  36. * the end time
  37. * @param integer $count
  38. * log count of histogram that query hits
  39. * @param string $progress
  40. * histogram query status(Complete or InComplete)
  41. */
  42. public function __construct($from, $to, $count, $progress) {
  43. $this->from = $from;
  44. $this->to = $to;
  45. $this->count = $count;
  46. $this->progress = $progress;
  47. }
  48. /**
  49. * Get begin time
  50. *
  51. * @return integer the begin time
  52. */
  53. public function getFrom() {
  54. return $this->from;
  55. }
  56. /**
  57. * Get the end time
  58. *
  59. * @return integer the end time
  60. */
  61. public function getTo() {
  62. return $this->to;
  63. }
  64. /**
  65. * Get log count of histogram that query hits
  66. *
  67. * @return integer log count of histogram that query hits
  68. */
  69. public function getCount() {
  70. return $this->count;
  71. }
  72. /**
  73. * Check if the histogram is completed
  74. *
  75. * @return bool true if this histogram is completed
  76. */
  77. public function isCompleted() {
  78. return $this->progress == 'Complete';
  79. }
  80. }