square / metrics

Metrics Query Engine
Apache License 2.0
170 stars 21 forks source link

Add hard limit on request size #257

Closed Nathan-Fenner closed 8 years ago

Nathan-Fenner commented 8 years ago

This enforces a limit on the size of a fetchable query.

The slot limit prevents you from writing (for example)

select cpu.percent
from -300yr to now

but it doesn't prevent you from writing

select cpu.percent | transform.moving_average(300yr)
from -1d to now

which both perform similar amounts of fetching.

This PR places a hard limit on the length of a single request. In particular, it's 10x whatever the regular slot limit is- so if you're only allowed 2,000 points in a regular query, an intermediate query (moving average or forecast fetch) can only contain up to 20,000 points.

TODO: add tests

TODO: also do this for numbers