Exemplo n.º 1
0
 /**
  * Add sample for submission
  *
  * @param $value            float                   Sample value
  * @param $timestamp        \DateTime|Carbon|int    Timestamp (defaults to current, can be used for backfilling)
  */
 public function sample($value = 1.0, $timestamp = null)
 {
     if ($timestamp instanceof \DateTime || $timestamp instanceof Carbon) {
         $timestamp = $timestamp->getTimestamp();
     }
     Assertion::nullOrInteger($timestamp, 'The timestamp should be null (= current timestamp), a UNIX timestamp or a DateTime instance');
     $timestamp = $timestamp === null ? time() : $timestamp;
     $this->samples[$timestamp][] = $value;
 }
Exemplo n.º 2
0
 /**
  * @param int $yAxisMin
  */
 public function setYAxisMin($yAxisMin)
 {
     Assertion::nullOrInteger($yAxisMin);
     $this->yAxisMin = $yAxisMin;
 }