Status

()

Core
General
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

Trunk
mozilla43
Points:
---

Firefox Tracking Flags

(firefox43 fixed)

Details

(Whiteboard: [Power])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
I have a shell script that runs tools/power/rapl and powermetrics and extracts the most useful stat from them for Firefox, Safari and Chrome. It has become my starting point for evaluating power consumption on any new website. Example output can be seen in bug 1190719 comment 17.

I want to get this in the tree so other people can use it.
(Assignee)

Comment 1

3 years ago
Created attachment 8661088 [details] [diff] [review]
Add |mach power|

There is a "njn" comment in there for something I didn't know how to do --
check if we're running on Mac OS X 10.10 or later.
Attachment #8661088 - Flags: review?(mh+mozilla)
Comment on attachment 8661088 [details] [diff] [review]
Add |mach power|

Review of attachment 8661088 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/power/mach_commands.py
@@ +23,5 @@
> +        MachCommandBase.__init__(self, context)
> +
> +    @Command('power', category='misc',
> +        # njn: want to check for Mac 10.10 or above here...
> +        #conditions=[...],

You want to give a function that checks StrictVersion(platform.mac_ver()[0]) >= StrictVersion('10.10'), where StrictVersion is imported from distutils.version.

@@ +102,5 @@
> +        # could do this by properly parsing powermetrics output, but it's
> +        # simpler and more robust to just grep for a handful of identifying
> +        # strings.
> +
> +        print()

Why the empty line?
Attachment #8661088 - Flags: review?(mh+mozilla) → feedback+
(Assignee)

Comment 3

3 years ago
> > +        print()
> 
> Why the empty line?

So there's a blank line between the rapl output and the powermetrics output. I'll add a comment.
(Assignee)

Comment 4

3 years ago
Created attachment 8662153 [details] [diff] [review]
Add |mach power|

Now with a proper "OS X 10.10 or greater" condition.
Attachment #8662153 - Flags: review?(mh+mozilla)
(Assignee)

Updated

3 years ago
Attachment #8661088 - Attachment is obsolete: true
Comment on attachment 8662153 [details] [diff] [review]
Add |mach power|

Review of attachment 8662153 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/power/mach_commands.py
@@ +18,5 @@
> +
> +
> +def is_osx_10_10_or_greater(cls):
> +    import platform
> +    mac_ver0 = platform.mac_ver()[0]

release would be a more explicit name than mac_ver0, and matches the definition of what mac_ver() returns.

@@ +110,5 @@
> +        # could do this by properly parsing powermetrics output, but it's
> +        # simpler and more robust to just grep for a handful of identifying
> +        # strings.
> +
> +        print()

You forgot comment 3.
Attachment #8662153 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/c7cc8e32b62f
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox43: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.