Ryan Harrison (Code Review)
unread,May 17, 2012, 10:36:39 AM5/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jon Kliegman, Sameer Nanda, Simon Arscott
Ryan Harrison has posted comments on this change.
Change subject: Send fan hysteresis data to chromium as UMA histogram
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(3 inline comments)
....................................................
File powerd_metrics.cc
Line 313: void Daemon::SendThermalMetrics(int aborted, int turned_on, int multiple) {
It is possible for aborted and turned_on to be 0 or aborted == - turned_on? This would give you a total value of 0, which you are using in the denominator.
You should catch this condition and log it. I don't think this should be a fatal issue, since metric generation is not essential to the usage of the device.
Line 330:
Negative values make no sense for these variables, correct? Should you change these to unsigned ints or be trimming and logging negative values here? I don't think it makes sense to have GeIntFromFile to trim, since it isn't obvious that a method with that name would have that side effect.
....................................................
File powerd_unittest.cc
Line 832: TEST_F(DaemonTest, SendThermalMetrics) {
You don't appear to be testing weird/odd values. The two cases that I have alluded to in other comments would be the total being 0 and some of these values being negative.
Gerrit-MessageType: comment
Gerrit-Change-Id: I57d69a6154a84b8dbbebe2a460230798d4ae16c6
Gerrit-PatchSet: 3
Gerrit-Project: chromiumos/platform/power_manager
Gerrit-Branch: master
Gerrit-Owner: Jon Kliegman <
kli...@chromium.org>