Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/telemetrygen/pkg/metrics/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (w worker) simulateMetrics(res *resource.Resource, exporter sdkmetric.Expor

// Add random values to the histogram
count := 10 + w.rand.IntN(20) // Random count between 10-30
for j := 0; j < count; j++ {
for range count {
value := float64(w.rand.IntN(1000))
hist.Update(value)
}
Expand Down
14 changes: 7 additions & 7 deletions cmd/telemetrygen/pkg/metrics/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func TestSumNoTelemetryAttrs(t *testing.T) {
require.Len(t, m.rms, qty)

rms := m.rms
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
assert.Equal(t, "test", ms.Name)
// @note update when telemetrygen allow other metric types
Expand Down Expand Up @@ -273,7 +273,7 @@ func TestGaugeNoTelemetryAttrs(t *testing.T) {
require.Len(t, m.rms, qty)

rms := m.rms
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
assert.Equal(t, "test", ms.Name)
// @note update when telemetrygen allow other metric types
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestSumSingleTelemetryAttr(t *testing.T) {
require.Len(t, m.rms, qty)

rms := m.rms
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
assert.Equal(t, "test", ms.Name)
// @note update when telemetrygen allow other metric types
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestGaugeSingleTelemetryAttr(t *testing.T) {
require.Len(t, m.rms, qty)

rms := m.rms
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
assert.Equal(t, "test", ms.Name)
// @note update when telemetrygen allow other metric types
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestSumMultipleTelemetryAttr(t *testing.T) {

rms := m.rms
var actualValue attribute.Value
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
// @note update when telemetrygen allow other metric types
attr := ms.Data.(metricdata.Sum[int64]).DataPoints[0].Attributes
Expand Down Expand Up @@ -398,7 +398,7 @@ func TestGaugeMultipleTelemetryAttr(t *testing.T) {

rms := m.rms
var actualValue attribute.Value
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
// @note update when telemetrygen allow other metric types
attr := ms.Data.(metricdata.Gauge[int64]).DataPoints[0].Attributes
Expand Down Expand Up @@ -636,7 +636,7 @@ func TestUniqueSumTimeseries(t *testing.T) {
rms := m.rms
var actualValue attribute.Value
var exist bool
for i := 0; i < qty; i++ {
for i := range qty {
ms := rms[i].ScopeMetrics[0].Metrics[0]
// @note update when telemetrygen allow other metric types
attr := ms.Data.(metricdata.Sum[int64]).DataPoints[0].Attributes
Expand Down
2 changes: 1 addition & 1 deletion cmd/telemetrygen/pkg/traces/traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ func TestSpanContextsBufferLimit(t *testing.T) {
}

// Add more span contexts than the buffer limit
for i := 0; i < 1200; i++ {
for i := range 1200 {
traceID, _ := trace.TraceIDFromHex(fmt.Sprintf("%032d", i))
spanID, _ := trace.SpanIDFromHex(fmt.Sprintf("%016d", i))
spanCtx := trace.NewSpanContext(trace.SpanContextConfig{
Expand Down