Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor db_profiler.pm to use current openQA best practices #2118

Merged
merged 3 commits into from Jun 18, 2019

Conversation

kraih
Copy link
Member

@kraih kraih commented Jun 18, 2019

This was a really strange module and quite inefficient. The OPENQA_SQL_DEBUG environment variable should now work consistently for all the webui services and use much less resources.

@kraih
Copy link
Member Author

kraih commented Jun 18, 2019

You can now do this.

$ OPENQA_SQL_DEBUG=1 script/openqa-scheduler daemon
[info] Listening at "http://127.0.0.1:9529"
Server available at http://127.0.0.1:9529
[info] Listening at "http://[::1]:9529"
Server available at http://[::1]:9529
[debug] [pid:26497] Scheduler default interval(ms): 1000
[debug] [pid:26497] Max job allocation: 80
[debug] [pid:26497] [DBIC] Took 0.00067401 seconds: SELECT COUNT( * ) FROM workers me
[debug] [pid:26497] [DBIC] Took 0.00040102 seconds: SELECT me.id, me.host, me.instance, me.job_id, me.upload_progress, me.error, me.t_created, me.t_updated FROM workers me WHERE ( ( error IS NULL AND job_id IS NULL ) )
[debug] [pid:26497] [rescheduling] Current tick is at 1000 ms. New tick will be in: 1000 ms
[debug] [pid:26497] [DBIC] Took 0.00073409 seconds: SELECT COUNT( * ) FROM workers me
[debug] [pid:26497] [DBIC] Took 0.00060916 seconds: SELECT me.id, me.host, me.instance, me.job_id, me.upload_progress, me.error, me.t_created, me.t_updated FROM workers me WHERE ( ( error IS NULL AND job_id IS NULL ) )
...

@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

Merging #2118 into master will decrease coverage by 13.84%.
The diff coverage is 41.17%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #2118       +/-   ##
===========================================
- Coverage   83.37%   69.52%   -13.85%     
===========================================
  Files         170      146       -24     
  Lines       10638     9760      -878     
===========================================
- Hits         8869     6786     -2083     
- Misses       1769     2974     +1205
Impacted Files Coverage Δ
lib/OpenQA/WebSockets.pm 88.4% <ø> (-0.17%) ⬇️
lib/OpenQA/Schema/Profiler.pm 40% <40%> (ø)
lib/OpenQA/Setup.pm 71.9% <50%> (-14.05%) ⬇️
lib/OpenQA/Git.pm 6.12% <0%> (-89.8%) ⬇️
lib/OpenQA/Parser/Result/Node.pm 14.28% <0%> (-85.72%) ⬇️
lib/OpenQA/Worker/Cache.pm 8.33% <0%> (-85.09%) ⬇️
lib/OpenQA/Parser/Result/OpenQA/Results.pm 20% <0%> (-80%) ⬇️
lib/OpenQA/Parser/Result/Test.pm 20% <0%> (-80%) ⬇️
lib/OpenQA/Parser/Result/OpenQA.pm 21.05% <0%> (-78.95%) ⬇️
lib/OpenQA/Parser.pm 21.69% <0%> (-78.31%) ⬇️
... and 104 more

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 54be86e...fe41732. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

Merging #2118 into master will increase coverage by 6.41%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2118      +/-   ##
==========================================
+ Coverage   83.37%   89.78%   +6.41%     
==========================================
  Files         170      170              
  Lines       10638    10626      -12     
==========================================
+ Hits         8869     9541     +672     
+ Misses       1769     1085     -684
Impacted Files Coverage Δ
lib/OpenQA/WebSockets.pm 94.2% <ø> (+5.63%) ⬆️
lib/OpenQA/Setup.pm 90.08% <100%> (+4.13%) ⬆️
lib/OpenQA/Schema/Profiler.pm 100% <100%> (ø)
lib/OpenQA/Worker/Commands.pm 81.17% <0%> (-2.36%) ⬇️
lib/OpenQA/Worker/Engines/isotovideo.pm 94.32% <0%> (+0.51%) ⬆️
lib/OpenQA/WebAPI.pm 97.15% <0%> (+0.71%) ⬆️
lib/OpenQA/WebAPI/Controller/LiveViewHandler.pm 96.46% <0%> (+1.32%) ⬆️
lib/OpenQA/WebAPI/Controller/API/V1/Job.pm 87.36% <0%> (+1.4%) ⬆️
lib/OpenQA/WebAPI/Controller/Running.pm 75.2% <0%> (+1.6%) ⬆️
... and 37 more

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 54be86e...fe41732. Read the comment docs.

@kraih kraih merged commit 08f60a7 into os-autoinst:master Jun 18, 2019
coolo pushed a commit that referenced this pull request Jun 18, 2019
commit 08f60a7
Merge: 54be86e fe41732
Author:     Sebastian Riedel <sri@cpan.org>
AuthorDate: Tue Jun 18 17:58:37 2019 +0200
Commit:     GitHub <noreply@github.com>
CommitDate: Tue Jun 18 17:58:37 2019 +0200

    Merge pull request #2118 from kraih/db_profiler

    Refactor db_profiler.pm to use current openQA best practices
okurz added a commit that referenced this pull request Jun 19, 2019
coolo pushed a commit that referenced this pull request Jun 19, 2019
commit a0cf10c
Merge: 08f60a7 59353a2
Author:     Oliver Kurz <okurz@suse.de>
AuthorDate: Wed Jun 19 11:17:13 2019 +0200
Commit:     GitHub <noreply@github.com>
CommitDate: Wed Jun 19 11:17:13 2019 +0200

    Merge pull request #2119 from okurz/fix/unzip

    Fix worker startup (fix #2118)
@kraih kraih deleted the db_profiler branch May 12, 2020 13:21
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.

None yet

2 participants