github.com/grafana/pyroscope@v1.18.0/pkg/og/storage/segment/timeline.go (about)

     1  package segment
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  type Timeline struct {
     8  	st                      time.Time
     9  	et                      time.Time
    10  	StartTime               int64    `json:"startTime"`
    11  	Samples                 []uint64 `json:"samples"`
    12  	durationDelta           time.Duration
    13  	DurationDeltaNormalized int64 `json:"durationDelta"`
    14  
    15  	// Watermarks map contains down-sampling watermarks (Unix timestamps)
    16  	// describing resolution levels of the timeline.
    17  	//
    18  	// Resolution in seconds is calculated as 10^k, where k is the map key.
    19  	// Meaning that any range within these 10^k seconds contains not more
    20  	// than one sample. Any sub-range less than 10^k shows down-sampled data.
    21  	//
    22  	// Given the map:
    23  	//  1: 1635508310
    24  	//  2: 1635507500
    25  	//  3: 1635506200
    26  	//
    27  	// This should be read as follows:
    28  	//  1. Data after 1635508310 is as precise as possible (10s resolution),
    29  	//     down-sampling was not applied.
    30  	//  2. Data before 1635508310 has resolution 100s
    31  	//  3. Data before 1635507500 has resolution 1000s
    32  	//  4. Data before 1635506200 has resolution 10000s
    33  	Watermarks map[int]int64 `json:"watermarks"`
    34  }