Skip to content

Commit af8e128

Browse files
lohanidamodarclaude
andcommitted
feat(usage-query): add 30m to VALID_INTERVALS
Fills the gap between 15m and 1h. Maps to ClickHouse `INTERVAL 30 MINUTE` like the other minute variants. Existing sub-hour entries (1m, 5m, 15m) already worked end-to-end via the aggregated find() path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 3111240 commit af8e128

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
vendor/
1+
vendor/
2+
.phpunit.result.cache
3+
.phpunit.cache/

.phpunit.result.cache

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Usage/UsageQuery.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class UsageQuery extends Query
3939
'1m' => 'INTERVAL 1 MINUTE',
4040
'5m' => 'INTERVAL 5 MINUTE',
4141
'15m' => 'INTERVAL 15 MINUTE',
42+
'30m' => 'INTERVAL 30 MINUTE',
4243
'1h' => 'INTERVAL 1 HOUR',
4344
'1d' => 'INTERVAL 1 DAY',
4445
'1w' => 'INTERVAL 1 WEEK',

tests/Usage/UsageQueryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testGroupByIntervalCreation(): void
2121

2222
public function testGroupByIntervalAllValidIntervals(): void
2323
{
24-
$validIntervals = ['1m', '5m', '15m', '1h', '1d', '1w', '1M'];
24+
$validIntervals = ['1m', '5m', '15m', '30m', '1h', '1d', '1w', '1M'];
2525

2626
foreach ($validIntervals as $interval) {
2727
$query = UsageQuery::groupByInterval('time', $interval);
@@ -114,6 +114,7 @@ public function testValidIntervalsConstant(): void
114114
$this->assertArrayHasKey('1m', UsageQuery::VALID_INTERVALS);
115115
$this->assertArrayHasKey('5m', UsageQuery::VALID_INTERVALS);
116116
$this->assertArrayHasKey('15m', UsageQuery::VALID_INTERVALS);
117+
$this->assertArrayHasKey('30m', UsageQuery::VALID_INTERVALS);
117118
$this->assertArrayHasKey('1h', UsageQuery::VALID_INTERVALS);
118119
$this->assertArrayHasKey('1d', UsageQuery::VALID_INTERVALS);
119120
$this->assertArrayHasKey('1w', UsageQuery::VALID_INTERVALS);

0 commit comments

Comments
 (0)