Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
add waitTime for each request
  • Loading branch information
huyan0 committed Aug 27, 2020
commit a56b60df491e16e57938298cfd767a16418c7a24
13 changes: 7 additions & 6 deletions test/otlploadgenerator/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ type sender struct {
}

var (
path = "./data.txt" // data file path
item = 1000 // total number of metrics / lines in output file
metric = "metricName" // base metricName. output file has only unique metricName with a number suffix
path = "./data.txt" // data file path
item = 1000 // total number of metrics / lines in output file
metric = "metricName" // base metricName. output file has only unique metricName with a number suffix
gauge = "gauge"
counter = "counter"
histogram = "histogram"
summary = "summary"
types = []string{
types = []string{ // types of metrics generatedq
counter,
gauge,
histogram,
summary,
}
labels = []string{ // each metric will have from 1 to 4 sets of labels
labels = []string{ // each metric will have from 1 to 4 sets of labels
"label1 value1",
"label2 value2",
"label3 value3",
Expand All @@ -43,6 +43,7 @@ var (
bounds = []float64{0.01, 0.5, 0.99} // fixed quantile/buckets

endpoint = "localhost:55680"
waitTime = 5 * time.Second // wait time between two sends
)

func main() {
Expand Down Expand Up @@ -124,7 +125,7 @@ func (s *sender) sendMetric(m *metrics.Metric) {
}
ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
_, err := s.client.Export(ctx, &request)
time.Sleep(5 * time.Second)
time.Sleep(waitTime)
if err != nil {
log.Fatal(err)
}
Expand Down