github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/pkg/storage/segment/constants.go (about)

     1  package segment
     2  
     3  import "time"
     4  
     5  // TODO: at some point we should change it so that segments can support different
     6  // resolution and multiplier values. For now they are constants
     7  const (
     8  	multiplier = 10
     9  	resolution = 10 * time.Second
    10  )
    11  
    12  var durations = []time.Duration{}
    13  
    14  func init() {
    15  	d := resolution
    16  	for i := 0; i < 50; i++ {
    17  		durations = append(durations, d)
    18  		newD := d * time.Duration(multiplier)
    19  		if newD < d {
    20  			return
    21  		}
    22  		d = newD
    23  	}
    24  }