Skip to content

Conversation

@OlivierCazade
Copy link
Contributor

Added more metrics to the kafka ingester and added timeout mecanics to the kafka tests.

@codecov-commenter
Copy link

Codecov Report

Merging #259 (933c8c4) into main (467e409) will decrease coverage by 1.44%.
The diff coverage is 78.18%.

@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
- Coverage   61.63%   60.19%   -1.45%     
==========================================
  Files          67       67              
  Lines        3915     4052     +137     
==========================================
+ Hits         2413     2439      +26     
- Misses       1350     1459     +109     
- Partials      152      154       +2     
Flag Coverage Δ
unittests 60.19% <78.18%> (-1.45%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/test/utils.go 65.04% <75.00%> (+0.69%) ⬆️
pkg/pipeline/ingest/ingest_kafka.go 77.98% <77.77%> (-2.79%) ⬇️
pkg/pipeline/ingest/ingest_grpc.go 75.82% <100.00%> (+0.26%) ⬆️
pkg/pipeline/write/write_stdout.go 59.37% <0.00%> (-40.63%) ⬇️
pkg/confgen/confgen.go 43.47% <0.00%> (-3.40%) ⬇️
pkg/confgen/config.go 42.85% <0.00%> (ø)
cmd/confgenerator/main.go 0.00% <0.00%> (ø)
cmd/flowlogs-pipeline/main.go 0.00% <0.00%> (ø)
pkg/confgen/flowlogs2metrics_config.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 467e409...933c8c4. Read the comment docs.

@OlivierCazade OlivierCazade changed the title Kafka metrics 2 NETOBSERV-465: Kafka metrics 2 Jul 19, 2022
flowErrors.With(prometheus.Labels{"router": "", "error": "No TimeFlowEnd found"}).Inc()
return
} else {
fmt.Println(TimeFlowEndInterface)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really want to print to stdout for each end of flow? or is this only for debug purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitly not, this is a debug trace that I forgot to remove.
Thanks

Comment on lines 169 to 170
func WaitFromChannel(in chan []config.GenericMap, timeout int64) ([]config.GenericMap, error) {
duration := time.Duration(timeout) * time.Millisecond
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it be more idiomatic to change the type of timeout from int64 to time.Duration?

Then, in the invocation side, one can argue that it is more apparent what the unit of time is:

test.WaitFromChannel(ingestOutput, 2 * time.Second)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point thanks!
I changed it.

@OlivierCazade OlivierCazade merged commit 4b46659 into netobserv:main Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants