Skip to content

Commit

Permalink
revert to original state
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Sep 25, 2024
1 parent 4917481 commit c8bd6d3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 32 deletions.
51 changes: 21 additions & 30 deletions internal/testbed/integration/combinedload/e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package combinedload

import (
"context"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -88,35 +89,25 @@ func TestLoad_Combined(t *testing.T) {
require.NoError(t, err)

t.Log("collecting data...")
// ctx, cancel := context.WithTimeout(context.Background(), 151*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():
// return
// }
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(), 151*time.Second)
defer cancel()
interval := 15 * time.Second
ticker := time.NewTicker(interval)
i := 0
for {
select {
case <-ticker.C:
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():
return
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ spec:
initialDelaySeconds: 3
resources:
limits:
cpu: 512m
memory: 1024Mi
cpu: 128m
memory: 256Mi
volumeMounts:
- mountPath: /conf
name: opentelemetry-collector-configmap
Expand Down

0 comments on commit c8bd6d3

Please sign in to comment.