ot-ns icon indicating copy to clipboard operation
ot-ns copied to clipboard

[dispatcher.go] Change log style of push status and unnecessary break - Part 1 of RTEA

Open Vinggui opened this issue 2 years ago • 3 comments

Contribution description

This PR is part of the process of breaking PR #235 in small steps, a process nominated "Road to Energy Analysis" (RTEA). These small modifications will lead to the whole improvement started on March 2022. At the end of these steps, OT-NS will be capable of precisely estimating energy consumption, collision events (channel aware), and plot all the data in real-time as the simulation progress.

At the moment, OT-NS can not estimate energy, collisions, nor transmission energy. Also, even though OT is working well in simulation, many of its recovery properties are not correctly simulated as they would happen in real devices due to its incorrect timing events at the simulated radio part.

Main modifications

This PR improved the readability of log messages when status push events happens in the simulator. Another cosmetic modification is the removal of unnecessary breaks. It addresses only the following files:

  • /dispatcher/dispatcher.go

Roadmap

This is part 1 of the RTEA (Road to Energy Analysis) steps to PR #235 and PR #7500.

Part 1: This PR; Part 2: PR #8144; Part 3: PR #359; Part 4: PR #8152; Part 5: PR #362; Part 6: PR #8165; Part 7: PR #363; Part 8: PR #8173; Part 9: PR #365; Part 10: PR #366; Part 11: PR #367.

Vinggui avatar Sep 11 '22 22:09 Vinggui

Codecov Report

Merging #357 (c73d897) into main (c616148) will decrease coverage by 0.06%. The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #357      +/-   ##
==========================================
- Coverage   49.97%   49.91%   -0.07%     
==========================================
  Files          38       38              
  Lines        4608     4602       -6     
==========================================
- Hits         2303     2297       -6     
  Misses       2123     2123              
  Partials      182      182              
Impacted Files Coverage Δ
web/site/bindata.go 99.00% <ø> (-0.01%) :arrow_down:
dispatcher/dispatcher.go 56.97% <50.00%> (-0.13%) :arrow_down:
otnstester/OtnsTest.go 89.44% <100.00%> (ø)

codecov-commenter avatar Sep 11 '22 22:09 codecov-commenter

The Develop workflow tests are failing. Is this expected?

jwhui avatar Sep 15 '22 20:09 jwhui

The Develop workflow tests are failing. Is this expected?

@jwhui I had a similar problem recently exactly on the same place. I thought that this could be the problem, but what I've tried didn't work. It was failing because of an old golangci-lint version being used. exportloopref Is causing this error at:

golangci-lint run -E goimports -E whitespace -E goconst -E exportloopref -E unconvert --fix bindata.go

At this link https://golangci-lint.run/usage/install/ we can see how to fix it.

# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0

golangci-lint --version

Vinggui avatar Sep 15 '22 20:09 Vinggui