Skip to content

Commit

Permalink
Fix sample chunk timestamp getters
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops committed Oct 22, 2024
1 parent 8bf3950 commit 573dc9c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/chunk/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ func (c SampleChunk) SDKVersion() string {
}

func (c SampleChunk) EndTimestamp() float64 {
return 0
count := len(c.Profile.Samples)
if count == 0 {
return 0
}
return c.Profile.Samples[count-1].Timestamp
}

func (c SampleChunk) GetEnvironment() string {
Expand Down Expand Up @@ -244,7 +248,10 @@ func (c SampleChunk) GetRetentionDays() int {
}

func (c SampleChunk) StartTimestamp() float64 {
return 0
if len(c.Profile.Samples) == 0 {
return 0
}
return c.Profile.Samples[0].Timestamp
}

func (c SampleChunk) GetOrganizationID() uint64 {
Expand Down

0 comments on commit 573dc9c

Please sign in to comment.