INNER CODE UNIT · Go
func
clickvisual/clickvisual · api/internal/pkg/agent/search/main.go:59
func (c *Component) IsChartRequest() bool {
return c.interval > 0
}
// preparePartition calculate the number of slices and the size of the slices
// TODO: consider further partitioning according to runtime.NumCPU()
func (c *Component) preparePartition(from, to int64) {
size := to - from + 1
switch {
case size <= 50*MB:
c.partitionNum = 1
c.partitionSize = 3 * MB
case size <= GB:
c.partitionNum = 2
c.partitionSize = 5 * MB
case size <= 2*GB:
c.partitionNum = 3
c.partitionSize = 3 * MB