protected function trackMeter($meterId, $buckets, $rates)
    {
        // create a key for this bucket's start time
        $trackKey = sprintf('track:%s', $buckets[0]);

        // track the meter key to this bucket with the number of times it was called
        $this->redis->hset($trackKey, $meterId, $rates[0]);

        // ensure this meter expires
        $expireAt = $buckets[0] + ($this->config['bucket_size'] * $this->config['num_buckets']);
        $this->redis->expireat($trackKey, $expireAt);
    }
protected function trackMeter($meterId, $buckets, $rates)
    {
        // create a key for this bucket's start time
        $trackKey = sprintf('track:%s', $buckets[0]);

        // track the meter key to this bucket with the number of times it was called
        $this->redis->hset($trackKey, $meterId, $rates[0]);

        // ensure this meter expires
        $expireAt = $buckets[0] + ($this->config['bucket_size'] * $this->config['num_buckets']);
        $this->redis->expireat($trackKey, $expireAt);
    }
protected function trackMeter ( $ meterId , $ buckets , $ rates ) { // create a key for this bucket's start time $ trackKey = sprintf ( 'track:%s' , $ buckets [ 0 ] ) ; // track the meter key to this bucket with the number of times it was called $ this -> redis -> hset ( $ trackKey , $ meterId , $ rates [ 0 ] ) ; // ensure this meter expires $ expireAt = $ buckets [ 0 ] + ( $ this -> config [ 'bucket_size' ] * $ this -> config [ 'num_buckets' ] ) ; $ this -> redis -> expireat ( $ trackKey , $ expireAt ) ; }
This method allows you to change how the meter is tracked
So if you'd like to use a sorted set rather than a hash,
go on ahead!
This method allows you to change how the meter is tracked So if you d like to use a sorted set rather than a hash go on ahead!