chore: adjust bucket_size in TopN (#102)

Co-authored-by: yaojiping <yaojiping@infini.ltd>
This commit is contained in:
yaojp123 2025-01-24 17:52:13 +08:00 committed by GitHub
parent 098371729e
commit 0fa4411041
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -285,7 +285,10 @@ export default (props) => {
}
if ((isAreaRate || isColorRate) || (isAreaLatency || isColorLatency)) {
body['time_field'] = "timestamp"
body['bucket_size'] = "auto"
body['bucket_size'] = "auto"
if (newTimeRange.max && newTimeRange.min) {
body['bucket_size'] = `${Math.round((newTimeRange.max - newTimeRange.min) / 1000)}s`
}
}
const res = await request(`/elasticsearch/infini_default_system_cluster/visualization/data`, {
method: 'POST',