intel / intel/gprofiler-performance-studio

Profile data selection logic from Clickhouse based on configurable retention

Open
#70 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
196
Forks
20
Avg merge
3d 15h
Merged PRs (30d)
2

Description

The current implementation had a critical flaw that caused identical data to be returned for different time ranges:

`
// OLD BUGGY LOGIC
retentionInterval := time.Hour * 24 * 14 // Fixed 14-day threshold
if now.Sub(start) >= retentionInterval {
// ❌ PROBLEM: Forces day-level aggregation too early
result["1day_historical"] = makeTimeRange(makeStartOfDay(start), makeEndOfDay(end))
return result // ❌ Both URLs get same day boundaries!
}
`

Problem Example:

URL 1: 2025-08-12T15:00:47Z → 2025-08-12T16:00:47Z
URL 2: 2025-08-12T16:00:24Z → 2025-08-12T17:00:24Z

Both became: 2025-08-12T00:00:00Z → 2025-08-12T23:59:59Z (identical!)

This was because of the hardcoded logic which assumes that retention period is 14 day set for Clickhouse. However, this set up can differ based on retention periods configured.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.