pmm icon indicating copy to clipboard operation
pmm copied to clipboard

PMM-4087 pmm agent metrics collection for itself

Open rishat-ishbulatov opened this issue 2 years ago • 4 comments

PMM-4087

Build: SUBMODULES-0

  • [ ] Links to other linked pull requests (optional).

rishat-ishbulatov avatar Oct 18 '22 10:10 rishat-ishbulatov

Codecov Report

Merging #1312 (bf5b942) into main (e090d0f) will increase coverage by 0.61%. Report is 3 commits behind head on main. The diff coverage is 61.84%.

:exclamation: Current head bf5b942 differs from pull request most recent head f589c9e. Consider uploading reports for the commit f589c9e to get more accurate results

@@            Coverage Diff             @@
##             main    #1312      +/-   ##
==========================================
+ Coverage   42.80%   43.42%   +0.61%     
==========================================
  Files         384      350      -34     
  Lines       48344    41423    -6921     
==========================================
- Hits        20693    17986    -2707     
+ Misses      25699    21899    -3800     
+ Partials     1952     1538     -414     
Flag Coverage Δ
agent 53.77% <61.84%> (+0.75%) :arrow_up:
vmproxy ?

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

Files Coverage Δ
agent/agents/supervisor/supervisor.go 64.77% <96.42%> (+7.52%) :arrow_up:
agent/client/client.go 42.81% <0.00%> (+0.61%) :arrow_up:
agent/connectionuptime/service.go 86.79% <96.15%> (+2.64%) :arrow_up:
agent/client/channel/channel.go 52.30% <43.29%> (-8.55%) :arrow_down:

... and 257 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Oct 25 '22 10:10 codecov[bot]

@michal-kralik I will be grateful for the suggestion.

rishat-ishbulatov avatar Oct 31 '22 15:10 rishat-ishbulatov

Hi, Michal. Fixed a place with mutex. According to linter errors, everything seems to be fixed, maybe with the exception of cyclomatic complexity, but there is just one switch. Regarding the refactoring proposal. No problem. Is it to be done as a service or... ? Maybe in the project there is an example of what you would like to see? I suppose this will also need to be done for the channel?

rishat-ishbulatov avatar Nov 01 '22 12:11 rishat-ishbulatov

Hi, Michal. Fixed a place with mutex. According to linter errors, everything seems to be fixed, maybe with the exception of cyclomatic complexity, but there is just one switch. Regarding the refactoring proposal. No problem. Is it to be done as a service or... ? Maybe in the project there is an example of what you would like to see? I suppose this will also need to be done for the channel?

I would suggest we create a metrics package in agent and client and store this information there. I'd be looking for a solution where the metrics logic would be separated from the application logic so the code is easier to understand and maintain.

Re linting - try running the linter locally such as bin/golangci-lint run -c=.golangci.yml --new-from-rev=main This prints a couple issues.

michal-kralik avatar Nov 02 '22 09:11 michal-kralik