-
Notifications
You must be signed in to change notification settings - Fork 17
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
Mac support: Program consumed 0 joules #54
Comments
Hi, could you run the powermetrics command as sudo in the terminal and show its output. |
Hi, This is the output (on stdout) that I get with Note, I do get a message on stderr:
|
Thanks. Could you run this command instead: |
We're usually looking for CPU/GPU or combined power lines on recent ARM Macs, which I don't see from the output you gave. |
I ran:
Hope it helps, and let me know if I can help :) |
I think that output was already in the first run as well, so just to be complete, I ran
|
Thanks. The line to be read is |
I'll see if I can create a patch. |
I can take care of it, if you haven't started already, @alamers. It is weird that there is so much variability between outputs for different models, specifically for Intel CPUs. |
Hi @metacosm, I just created a pull request 55. It was a bit more involved than I thought, and had to refactor a bit. It seemed that there could be unread lines in the buffered reader left, and that caused it to miss some messages. I reworked the reader to simply check if there is data with ready(), which should be enough to have intermittent results. I also added some testcases for these scenario's. Since I don't have an M1/M2 chip I used some example data from abhimanbhau.github.io, but maybe it is best to replace that with some other data. |
@alamers Great job! I do have a few comments and suggestions, see the PR review. Note that some of these improvements are available in a modified form in a project I created that simply re-publishes the power information on a REST endpoint for easier downstream consumption (https://github.com/metacosm/power-server), without any of the analysis that JoularJX is performing. |
Hi, I hope to find some time next week to look at the suggestions. |
Hi @metacosm and @adelnoureddine, I just had a look at the comments. If I understand correctly, @metacosm is ok with the pull request. My only concern is the test data that I scraped from a website, although it is just output from a tool, maybe better to replace it with content with approval? If so, @metacosm would you be able to provide a dump from machines that you have access to? The improvements as mentioned, as well as the relation with Also, is there a convenient way of reusing the code from |
Yes, I can certainly provide actual data from an M1 mac. Here's one such output: https://github.com/metacosm/power-server/blob/main/server/src/test/resources/sonoma-m1max.txt
I don't think there's anything to do in relation to But, yes,
That's an intriguing question, one I hadn't consider. |
Thanks @metacosm. I'll have to check your code in more detail, but with a quick glance, I think maybe there might be things useful for a future version of JoularJX. |
Thanks @alamers. We can generate testing data and store them to files ourselves. If you both agree (@metacosm too), you can generate such data in your machines with powermetrics and submit them in the PR. @alamers, there were additional comments by @metacosm as review on your code in the PR. Could you check them when you have some time, and comment/mark resolved (or implement if you want) on them? |
Indeed. I remember looking at it a while ago but then somewhat forgot about it. 😓 |
I've resolved all of the comments, performance wise it should be on par now again. One remark remains: the current implementation measures the whole of the system, it does not distribute the energy consumption over all pids. I am unsure if this is the expected behaviour? To fix that, a lot more is involved, such as parsing the process list. This is existing behaviour, so unrelated to this ticket, in any case. |
@alamers the per-process attribution is done by the code calling the power measure (using JMX to retrieve the share of CPU consumed by the current process), this is similar to what's done with the RAPL implementation where you don't get any granularity at all (you just get a µJ counter that's periodically checked for monitored system components (CPU, package, etc.)). |
Ah, I missed that part :) |
Yes, JoularJX gets the CPU energy, then calculate the application's energy (JVM), then each thread, and finally each method and branch. |
Hi!
I was trying out JoularJX on a Spring Boot application, on a macbook pro (intel) and I don't seem to be able to get it working. All measured values are 0.
I'm running the app as root, just to make sure I don't have any permission problems:
JoularJX seems to start up fine:
But when I terminate the program:
Needless to say, all output files are empty or contain 0 values.
Am I missing something?
The text was updated successfully, but these errors were encountered: