Skip to content

Commit 34c9b7a

Browse files
committed
LOG-6084: Replace functional-benchmark plot library
1 parent f54690e commit 34c9b7a

File tree

19 files changed

+461
-399
lines changed

19 files changed

+461
-399
lines changed

cmd/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func main() {
9393

9494
flag.Parse()
9595

96-
logger := utils.InitLogger("cluster-logging-operator")
96+
logger := utils.InitStaticLogger("cluster-logging-operator")
9797
// LOG-5136 Fixes error caused by updates to controller-runtime
9898
ctrl.SetLogger(logger)
9999

go.mod

+10
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ require (
2121
github.com/prometheus/client_golang v1.20.5
2222
github.com/spf13/pflag v1.0.6
2323
github.com/stretchr/testify v1.10.0
24+
github.com/vspaz/wls-go v0.0.0-20230405190232-47d1e477c82c
2425
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac
2526
golang.org/x/net v0.37.0
2627
golang.org/x/sync v0.12.0
2728
golang.org/x/sys v0.32.0
29+
gonum.org/v1/plot v0.16.0
2830
k8s.io/api v0.32.2
2931
k8s.io/apimachinery v0.32.2
3032
k8s.io/apiserver v0.32.2
@@ -36,11 +38,17 @@ require (
3638

3739
require (
3840
cel.dev/expr v0.18.0 // indirect
41+
codeberg.org/go-fonts/liberation v0.5.0 // indirect
42+
codeberg.org/go-latex/latex v0.1.0 // indirect
43+
codeberg.org/go-pdf/fpdf v0.10.0 // indirect
44+
git.sr.ht/~sbinet/gg v0.6.0 // indirect
45+
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
3946
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
4047
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
4148
github.com/aws/smithy-go v1.8.0 // indirect
4249
github.com/beorn7/perks v1.0.1 // indirect
4350
github.com/blang/semver/v4 v4.0.0 // indirect
51+
github.com/campoy/embedmd v1.0.0 // indirect
4452
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
4553
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4654
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@@ -56,6 +64,7 @@ require (
5664
github.com/go-openapi/swag v0.23.0 // indirect
5765
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
5866
github.com/gogo/protobuf v1.3.2 // indirect
67+
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
5968
github.com/golang/protobuf v1.5.4 // indirect
6069
github.com/google/cel-go v0.22.0 // indirect
6170
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
@@ -93,6 +102,7 @@ require (
93102
go.uber.org/automaxprocs v1.6.0 // indirect
94103
go.uber.org/multierr v1.11.0 // indirect
95104
go.uber.org/zap v1.27.0 // indirect
105+
golang.org/x/image v0.25.0 // indirect
96106
golang.org/x/oauth2 v0.27.0 // indirect
97107
golang.org/x/term v0.30.0 // indirect
98108
golang.org/x/text v0.23.0 // indirect

go.sum

+36
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo=
22
cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
3+
codeberg.org/go-fonts/dejavu v0.4.0 h1:2yn58Vkh4CFK3ipacWUAIE3XVBGNa0y1bc95Bmfx91I=
4+
codeberg.org/go-fonts/dejavu v0.4.0/go.mod h1:abni088lmhQJvso2Lsb7azCKzwkfcnttl6tL1UTWKzg=
5+
codeberg.org/go-fonts/latin-modern v0.4.0 h1:vkRCc1y3whKA7iL9Ep0fSGVuJfqjix0ica9UflHORO8=
6+
codeberg.org/go-fonts/latin-modern v0.4.0/go.mod h1:BF68mZznJ9QHn+hic9ks2DaFl4sR5YhfM6xTYaP9vNw=
7+
codeberg.org/go-fonts/liberation v0.5.0 h1:SsKoMO1v1OZmzkG2DY+7ZkCL9U+rrWI09niOLfQ5Bo0=
8+
codeberg.org/go-fonts/liberation v0.5.0/go.mod h1:zS/2e1354/mJ4pGzIIaEtm/59VFCFnYC7YV6YdGl5GU=
9+
codeberg.org/go-latex/latex v0.1.0 h1:hoGO86rIbWVyjtlDLzCqZPjNykpWQ9YuTZqAzPcfL3c=
10+
codeberg.org/go-latex/latex v0.1.0/go.mod h1:LA0q/AyWIYrqVd+A9Upkgsb+IqPcmSTKc9Dny04MHMw=
11+
codeberg.org/go-pdf/fpdf v0.10.0 h1:u+w669foDDx5Ds43mpiiayp40Ov6sZalgcPMDBcZRd4=
12+
codeberg.org/go-pdf/fpdf v0.10.0/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoPOc4LjU=
13+
git.sr.ht/~sbinet/cmpimg v0.1.0 h1:E0zPRk2muWuCqSKSVZIWsgtU9pjsw3eKHi8VmQeScxo=
14+
git.sr.ht/~sbinet/cmpimg v0.1.0/go.mod h1:FU12psLbF4TfNXkKH2ZZQ29crIqoiqTZmeQ7dkp/pxE=
15+
git.sr.ht/~sbinet/gg v0.6.0 h1:RIzgkizAk+9r7uPzf/VfbJHBMKUr0F5hRFxTUGMnt38=
16+
git.sr.ht/~sbinet/gg v0.6.0/go.mod h1:uucygbfC9wVPQIfrmwM2et0imr8L7KQWywX0xpFMm94=
17+
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
318
github.com/ViaQ/logerr/v2 v2.1.0 h1:8WwzuNa1x+a6tRUl+6sFel83A/QxlFBUaFW2FyG2zzY=
419
github.com/ViaQ/logerr/v2 v2.1.0/go.mod h1:/qoWLm3YG40Sv5u75s4fvzjZ5p36xINzaxU2L+DJ9uw=
20+
github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY=
21+
github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk=
22+
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
23+
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
524
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
625
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
726
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
@@ -18,6 +37,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
1837
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
1938
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
2039
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
40+
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
41+
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
2142
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
2243
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
2344
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -58,6 +79,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
5879
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
5980
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4=
6081
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU=
82+
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
83+
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
6184
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
6285
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
6386
github.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g=
@@ -159,6 +182,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
159182
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
160183
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
161184
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
185+
github.com/vspaz/wls-go v0.0.0-20230405190232-47d1e477c82c h1:gc7YbOdV619w8KYK71jClfbq6m89wJkCVTAko8DNtfY=
186+
github.com/vspaz/wls-go v0.0.0-20230405190232-47d1e477c82c/go.mod h1:sN2G8r+ME16x0qBg571lKYvJe9dLgY5Kil58P7dm1Vw=
162187
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
163188
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
164189
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -192,6 +217,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
192217
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
193218
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac h1:l5+whBCLH3iH2ZNHYLbAe58bo7yrN4mVcnkHDYz5vvs=
194219
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac/go.mod h1:hH+7mtFmImwwcMvScyxUhjuVHR3HGaDPMn9rMSUUbxo=
220+
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
221+
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
195222
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
196223
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
197224
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -210,6 +237,7 @@ golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
210237
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
211238
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
212239
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
240+
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
213241
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
214242
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
215243
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
@@ -224,6 +252,7 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
224252
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
225253
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
226254
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
255+
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
227256
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
228257
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
229258
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -232,6 +261,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
232261
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
233262
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
234263
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
264+
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
265+
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
266+
gonum.org/v1/plot v0.16.0 h1:dK28Qx/Ky4VmPUN/2zeW0ELyM6ucDnBAj5yun7M9n1g=
267+
gonum.org/v1/plot v0.16.0/go.mod h1:Xz6U1yDMi6Ni6aaXILqmVIb6Vro8E+K7Q/GeeH+Pn0c=
235268
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=
236269
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo=
237270
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs=
@@ -251,6 +284,7 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
251284
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
252285
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
253286
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
287+
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
254288
k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw=
255289
k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y=
256290
k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4=
@@ -269,6 +303,8 @@ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJ
269303
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
270304
k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0=
271305
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
306+
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
307+
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
272308
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo=
273309
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
274310
sigs.k8s.io/controller-runtime v0.19.6 h1:fuq53qTLQ7aJTA7aNsklNnu7eQtSFqJUomOyM+phPLk=

internal/cmd/forwarder-generator/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
// HACK - This command is for development use only
2121
func main() {
22-
utils.InitLogger("forwarder-generator")
22+
utils.InitStaticLogger("forwarder-generator")
2323

2424
yamlFile := flag.String("file", "", "ClusterLogForwarder yaml file. - for stdin")
2525
debugOutput := flag.Bool("debug-output", false, "Generate config normally, but replace output plugins with @stdout plugin, so that records can be printed in collector logs.")

internal/cmd/functional-benchmarker/config/options.go

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type Options struct {
2424
Image string
2525
TotalMessages int
2626
MsgSize int
27-
Verbosity int
2827
BaseLine bool
2928
DoCleanup bool
3029
Sample bool
@@ -53,7 +52,6 @@ func InitOptions() Options {
5352
//fs.IntVar(&options.TotalMessages, "tot-messages", 10000, "The number of messages to write per stressor")
5453
fs.IntVar(&options.MsgSize, "size", 1024, "The message size in bytes per stressor for 'synthetic' payload")
5554
fs.IntVar(&options.LinesPerSecond, "lines-per-sec", 1, "The log lines per second per stressor")
56-
fs.IntVar(&options.Verbosity, "verbosity", 0, "The output log level")
5755
fs.BoolVar(&options.DoCleanup, "do-cleanup", true, "set to false to preserve the namespace")
5856
//fs.BoolVar(&options.BaseLine, "baseline", false, "run the test with a baseline config. This supercedes --collector-config")
5957
//fs.StringVar(&options.Platform, "platform", "cluster", "The runtime environment: cluster, local. local requires podman")

internal/cmd/functional-benchmarker/main.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,23 @@ import (
1212
"github.com/openshift/cluster-logging-operator/internal/constants"
1313
"github.com/openshift/cluster-logging-operator/test/helpers/oc"
1414

15-
log "github.com/ViaQ/logerr/v2/log/static"
1615
"github.com/openshift/cluster-logging-operator/internal/cmd/functional-benchmarker/config"
1716
"github.com/openshift/cluster-logging-operator/internal/cmd/functional-benchmarker/reports"
1817
"github.com/openshift/cluster-logging-operator/internal/cmd/functional-benchmarker/runners"
1918
"github.com/openshift/cluster-logging-operator/internal/cmd/functional-benchmarker/stats"
2019
"github.com/openshift/cluster-logging-operator/internal/utils"
2120
)
2221

22+
var (
23+
log = utils.InitLogger("functional-benchmarker")
24+
)
25+
2326
// HACK - This command is for development use only
2427
func main() {
2528
utils.InitLogger("functional-benchmarker")
26-
29+
defer func() {
30+
log.Info("Test complete")
31+
}()
2732
options := config.InitOptions()
2833

2934
options.CollectorConfig = config.ReadConfig(options.CollectorConfigPath, options.BaseLine)
@@ -42,13 +47,15 @@ func main() {
4247

4348
options.CollectorConfig = config
4449
reporter := reports.NewReporter(options, artifactDir, metrics, statistics)
50+
log.Info("Generating reports...")
4551
reporter.Generate()
4652
}
4753

4854
func RunBenchmark(artifactDir string, options config.Options) (*stats.ResourceMetrics, *stats.Statistics, string, error) {
4955
runDuration := config.MustParseDuration(options.RunDuration, "run-duration")
5056
sampleDuration := config.MustParseDuration(options.SampleDuration, "resource-sample-duration")
5157
runner := runners.NewRunner(options)
58+
log.Info("Deploying collector, loaders, and receivers")
5259
runner.Deploy()
5360
if options.DoCleanup {
5461
log.V(2).Info("Deferring cleanup", "DoCleanup", options.DoCleanup)
@@ -58,6 +65,7 @@ func RunBenchmark(artifactDir string, options config.Options) (*stats.ResourceMe
5865
startTime := time.Now()
5966
sampler := time.NewTicker(sampleDuration)
6067
metrics := stats.NewResourceMetrics()
68+
log.V(0).Info("Starting to sample metrics for the collector...")
6169
go func() {
6270
for {
6371
select {
@@ -76,6 +84,8 @@ func RunBenchmark(artifactDir string, options config.Options) (*stats.ResourceMe
7684
endTime := time.Now()
7785
done <- true
7886
sampler.Stop()
87+
log.Info("Stopped sampling metrics")
88+
log.Info("Fetching log data from receiver...")
7989
if err := runner.FetchApplicationLogs(); err != nil {
8090
return nil, nil, "", err
8191
}
@@ -105,6 +115,7 @@ func fetchContainerLogs(runner runners.Runner, artifactDir string) {
105115
}
106116

107117
func gatherStatistics(runner runners.Runner, sample bool, msgSize int, startTime, endTime time.Time) *stats.Statistics {
118+
log.Info("Evaluating log data to calculate statistics")
108119
logs, err := runner.ReadApplicationLogs()
109120
if err != nil {
110121
log.Error(err, "Error reading logs")

internal/cmd/functional-benchmarker/reports/gnuplot/plot_scripts.go renamed to internal/cmd/functional-benchmarker/reports/format_templates.go

+9-53
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,6 @@
1-
package gnuplot
1+
package reports
22

33
const (
4-
cpuPlotPNG = `set term png size 1024,768
5-
set output 'cpu.png'
6-
set timefmt '%s'
7-
set xdata time
8-
set title 'CPU(Cores)'
9-
set xlabel 'Time'
10-
plot 'cpu.data' using 1:2 with lines`
11-
12-
memPlotPNG = `set term png size 1024,768
13-
set output 'mem.png'
14-
set timefmt '%s'
15-
set xdata time
16-
set title 'Mem(Mb)'
17-
set xlabel 'Time'
18-
plot 'mem.data' using 1:2 with lines`
19-
20-
latencyPlotPNG = `set term png size 1024,768
21-
set output 'latency.png'
22-
set title 'Latency(s)'
23-
set xlabel 'Message'
24-
f(x)=m*x+b
25-
fit f(x) 'latency.data' using 1:2 via m,b
26-
plot 'latency.data' using 1:2 with lines title 'Data', f(x) title 'Trend'`
27-
28-
lossPlotPNG = `set term png size 1024,768
29-
set output 'loss.png';
30-
set xlabel 'SeqId';
31-
set ylabel 'Lost Count'`
32-
33-
lossPlotDumb = `set term dumb
34-
set xlabel 'SeqId';
35-
set ylabel 'Lost Count'`
36-
37-
cpuPlotDumb = `set term dumb
38-
set timefmt '%s'
39-
set xdata time
40-
set title 'CPU(Cores)'
41-
set xlabel 'Time'
42-
plot 'cpu.data' using 1:2 with lines`
43-
44-
memPlotDumb = `set term dumb
45-
set timefmt '%s'
46-
set xdata time
47-
set title 'Mem(Mb)'
48-
set xlabel 'Time'
49-
plot 'mem.data' using 1:2 with lines`
50-
51-
latencyPlotDumb = `set term dumb
52-
set title 'Latency(s)'
53-
set xlabel 'Message'
54-
plot 'latency.data' using 1:2 with lines`
55-
564
html = `
575
<html>
586
<div>
@@ -98,15 +46,23 @@ plot 'latency.data' using 1:2 with lines`
9846
<div>
9947
<img src="cpu.png">
10048
</div>
49+
<br/>
50+
<br/>
10151
<div>
10252
<img src="mem.png">
10353
</div>
54+
<br/>
55+
<br/>
10456
<div>
10557
<img src="latency.png">
10658
</div>
59+
<br/>
60+
<br/>
10761
<div>
10862
<img src="loss.png">
10963
</div>
64+
<br/>
65+
<br/>
11066
<div>
11167
<table border="1">
11268
<tr>

0 commit comments

Comments
 (0)