简体   繁体   中英

Can Cube (js metrics framework) return more than 1000 events?

The Cube software ( https://github.com/square/cube ) allows you to retrieve events.

I want to retrieve a lot of events. But it appears that I am capped at 1000. There are well over 9000 in mongodb in the collection and time range I am querying

Example http GET queries I issue:

# 1000 results
http://1.2.3.4:1081/1.0/event?expression=my_event_type
# 1000 results
http://1.2.3.4:1081/1.0/event?expression=my_event_type&start=2012-02-02&stop=2013-07-03
# 7 results
http://1.2.3.4:1081/1.0/event?expression=my_event_type&limit=7
# 1000 results
http://1.2.3.4:1081/1.0/event?expression=my_event_type&limit=9999

It appears that the limit is pinned: https://github.com/square/cube/blob/28dad4af27a6680deb46077b16952590f2c21cad/lib/cube/event.js Line 166 based on the 'batchSize=1000'

Is it possible that you can 'page' through the data in some way? Or is this just a hard limit?

Looks like there is a hard cap on results in three places that need to be updated for large domains:

  • event.js - line 166
  • metric.js - line 11
  • metric.js - line 12

In addition, I was unable to find any query-string apis for the parameters. Ideally, we can leave the cap at 1000 (to avoid server bloat for people not tuning their queries correctly) and allow the consumer to define override behavior.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM