Skip to content

Commit

Permalink
Update internal/testbed/integration/combinedload/e2e_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Bacher <[email protected]>
  • Loading branch information
odubajDT and bacherfl authored Sep 25, 2024
1 parent 4f8a021 commit 0f878dd
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions internal/testbed/integration/combinedload/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,24 @@ func TestLoad_Combined(t *testing.T) {
require.NoError(t, err)

t.Log("collecting data...")
for seconds := 15; seconds < 151; seconds += 15 {
time.Sleep(15 * time.Second)

//fetch metrics data
cpu, mem, err := k8stest.FetchPodMetrics(metricsClientSet, testNs, otelColPodName)
require.NoError(t, err)

t.Log("------------------------------------------------------")
t.Logf("data after %d seconds:", seconds)
t.Logf("memory: %s, cpu: %s", mem, cpu)
t.Log("------------------------------------------------------")
ctx, cancel := context.WithTimeout(context.Background(), 150*time.Second)
defer cancel()
interval := 15 * time.Second
i := 0
for {
select {
case <-time.After(interval):
i += 1
//fetch metrics data
cpu, mem, err := k8stest.FetchPodMetrics(metricsClientSet, testNs, otelColPodName)
require.NoError(t, err)

t.Log("------------------------------------------------------")
t.Logf("data after %d seconds:", i * int(interval.Seconds()))
t.Logf("memory: %s, cpu: %s", mem, cpu)
t.Log("------------------------------------------------------")
case <-ctx.Done():
break
}
}
}

0 comments on commit 0f878dd

Please sign in to comment.