private function getBucketIndex($bucketNumber, $time)
    {
        // Getting unique bucket index
        return floor(($time - $bucketNumber * $this->bucketInMilliseconds) / $this->bucketInMilliseconds);
    }