Skip to content

Commit 8af2740

Browse files
author
Piotr
committed
demo data updates
1 parent e04882b commit 8af2740

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modes/demo.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ func GenerateRandomData(jsonFormat bool, numPerSec int, ch chan models.Message,
7878
}
7979

8080
func generateTextRandomData() string {
81+
b := gofakeit.Bool()
82+
bs := "false"
83+
if b {
84+
bs = "true"
85+
}
8186
return strings.Join([]string{
8287
time.Now().Format("15:04:05.0000"),
8388
strconv.Itoa(int(time.Now().UnixMilli())),
@@ -90,11 +95,12 @@ func generateTextRandomData() string {
9095
gofakeit.UserAgent(),
9196
gofakeit.HTTPMethod(),
9297
utils.PickRandom[string](correlationIds),
98+
bs,
9399
}, " | ")
94100
}
95101

96102
func generateJsonRandomData() string {
97-
val, _ := json.Marshal(map[string]string{
103+
val, _ := json.Marshal(map[string]interface{}{
98104
"ts": time.Now().Format("15:04:05.0000"),
99105
"unix": strconv.Itoa(int(time.Now().UnixMilli())),
100106
"duration": strconv.Itoa(rand.Intn(500-300) + 300),
@@ -106,6 +112,7 @@ func generateJsonRandomData() string {
106112
"ua": gofakeit.UserAgent(),
107113
"method": gofakeit.HTTPMethod(),
108114
"correlation_id": utils.PickRandom[string](correlationIds),
115+
"active": gofakeit.Bool(),
109116
})
110117

111118
return string(val)

0 commit comments

Comments
 (0)