Skip to content

Commit 241ec87

Browse files
authored
Merge pull request palicao#23 from palicao/support-1.4-features
Support 1.4 features
2 parents 3cf33b0 + f0e99b7 commit 241ec87

31 files changed

+865
-598
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ RUN pecl install redis && \
1111
pecl install xdebug && \
1212
docker-php-ext-enable redis xdebug
1313

14-
RUN wget https://github.com/composer/composer/releases/download/1.10.10/composer.phar -q &&\
14+
RUN wget https://github.com/composer/composer/releases/download/2.0.12/composer.phar -q && \
1515
mv composer.phar /usr/bin/composer && \
1616
chmod +x /usr/bin/composer
17-

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ Use [Redis Time Series](https://oss.redislabs.com/redistimeseries/) in PHP!
1717
### Requirements
1818
The library is tested against:
1919
- PHP 7.2, 7.3 and 7.4
20-
- RedisTimeSeries 1.2.7 and 1.4.2 (but it should work with any 1.2 and 1.4 version)
20+
- RedisTimeSeries 1.4.8 (but it should work with any 1.4 version)
21+
22+
In order to use RedisTimeSeries 1.2 please use version 2.1.1 of this library.
2123

2224
### Construct
2325
```
@@ -113,20 +115,26 @@ See https://oss.redislabs.com/redistimeseries/commands/#tsdeleterule.
113115

114116
### `range`
115117

116-
`TimeSeries::range(string $key, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null, ?int $count = null, ?AggregationRule $rule = null): Sample[]`
118+
`TimeSeries::range(string $key, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null, ?int $count = null, ?AggregationRule $rule = null, bool $reverse = false): Sample[]`
117119

118120
Retrieves samples from a key. It's possible to limit the query in a given time frame (passing `$from` and `$to`),
119121
to limit the retrieved amount of samples (passing `$count`), and also to pre-aggregate the results using a `$rule`.
120122

123+
The flag `$reverse` will return the results in reverse time order.
124+
121125
See https://oss.redislabs.com/redistimeseries/commands/#tsrange.
122126

123-
### `multiRange` and `multiRangeRaw`
127+
### `multiRange` and `multiRangeWithLabels`
128+
129+
`TimeSeries::multiRange(Filter $filter, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null, ?int $count = null, ?AggregationRule $rule = null, bool $reverse = false): Sample[]`
130+
131+
`TimeSeries::multiRangeWithLabels(Filter $filter, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null, ?int $count = null, ?AggregationRule $rule = null, bool $reverse = false): SampleWithLabels[]`
124132

125-
`TimeSeries::multiRange(Filter $filter, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null, ?int $count = null, ?AggregationRule $rule = null): Sample[]`
133+
Similar to `range`, but instead of querying by key, queries for a specific set of labels specified in `$filter`.
126134

127-
`TimeSeries::multiRangeRaw(Filter $filter, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null, ?int $count = null, ?AggregationRule $rule = null): array[]`
135+
`multiRangeWithLabels` will return an array of `SampleWithLabels` instead of simple `Sample`s.
128136

129-
Similar to `range`, but instead of querying by key, queries for a specific set of labels specified in `$filter`. `multiRangeRaw` will return the raw result from Redis, in order to preserve label information.
137+
The flag `$reverse` will return the results in reverse time order.
130138

131139
See https://oss.redislabs.com/redistimeseries/commands/#tsmrange.
132140

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "palicao/php-redis-time-series",
3+
"description": "Use Redis Time Series in PHP",
34
"license": "MIT",
45
"authors": [
56
{
@@ -23,6 +24,6 @@
2324
},
2425
"require-dev": {
2526
"phpunit/phpunit": "^8.3",
26-
"vimeo/psalm": "^3.5"
27+
"vimeo/psalm": "^4.7"
2728
}
2829
}

0 commit comments

Comments
 (0)