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

Migrate to quarkus and add locale setting #20

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

vincejv
Copy link

@vincejv vincejv commented Oct 30, 2023

Fixes: #19 & #15

Locale setting is defined in Environment variable: QBITTORRENT_LOCALE, defaults to en-US, uses IETF BCP 47 language tag (also see RFC 4647 "Matching of Language Tags" and RFC 5646 "Tags for Identifying Languages").

To review:

  • Implications in using quarkus and compiling to native code
  • Documentation update for environment variable

@Quinten0508
Copy link

Seems like #15 is not completely fixed, at least not on my end. Changed locale to nl-NL to match qBit but the resulting values simply remove the comma entirely (e.g. 10,90 becomes 1090). Same thing seems to happen with fr-FR, which you recommended in the issue.

@vincejv
Copy link
Author

vincejv commented Nov 4, 2023

Hello @Quinten0508 , appreciate your effort for testing it!
Can you also check and/or provide screenshot if the value for Global Ratio reflects the same in prometheus when querying it with promql directly? Grafana or Prometheus screenshot will do, see below for example, or can also call on the exporter's /metrics endpoint directly and provide the output here.

I have a suspicion that some parts like individual torrent ratios are still not fixed this seems to be not the issue, just wanted to check if at least the Global ratio is fixed. Will push updates on this PR if it seems to be the issue

image
image

@Quinten0508
Copy link

Quinten0508 commented Nov 4, 2023

Can confirm, global ratio is also wrong within Prometheus. Real share ratio should be 10,90 (or 10.90). Same goes for the /metrics endpoint. In the second screenshot you can see it does add a decimal dot, just not in the right spot (1090.0 instead of 10.90)
image
image

@Quinten0508
Copy link

Might be worth noting that within the docker container's logs, the following error keeps showing up every time it scrapes new data: 2023-11-04 14:48:18,858 WARN [qbi.api.gso.LongTypeAdapter] (executor-thread-1) Could not read long None which had an invalid long value. Defaulting value to 0. Not sure if this has to do with the global ratio conversion or if it's completely unrelated. Setting the env variable LOG_LEVEL=DEBUG does not do anything.

@vincejv
Copy link
Author

vincejv commented Nov 5, 2023

I've opened an issue with the upstream framework, might be an issue caused by Quarkus/GraalVM native. This might be caused by upstream not by the code itself.
quarkusio/quarkus#36876

@vincejv
Copy link
Author

vincejv commented Nov 6, 2023

Hi @Quinten0508
I've made some workarounds to issues with the framework, please pull the latest image (vincejv/qbittorrent-exporter), I personally tested it on my end as well by manually changing the locales. Thanks.

@Quinten0508
Copy link

Just pulled the latest image and it seems to be working now! Thanks :D

image
image

@vincejv vincejv marked this pull request as ready for review December 3, 2023 13:26
@vincejv vincejv marked this pull request as draft January 23, 2024 03:34
@vincejv
Copy link
Author

vincejv commented Jan 23, 2024

Holding off as draft until Quarkus 3.7 3.8, which is an LTS release.
But this PR has been stable so far after 3 months of usage, no OOM crashes or errors, no regressions in correctness/performance. Resource usage is consistent on earlier posts, 20-50mb RAM idle compared to pure JVM.

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.

[Feature Request] Compile to native code through GraalVM to minimize RAM usage
2 participants