For #10434: Handle cases when proc/$pid/stat is not accessible. #10481
Conversation
@mcomella I wasn't sure how we would want to handle exceptions. I thought that a value of 0 will be ignored when assessing this metric. Let me know if this should be handled differently. TY! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this! I think reporting 0 is misleading in our data so I think we should either not record or record a new error.
app/src/main/java/org/mozilla/fenix/perf/StartupFrameworkStartMeasurement.kt
Outdated
Show resolved
Hide resolved
try { | ||
stat.getProcessStartTimeTicks(Process.myPid()) | ||
} catch (e: NegativeArraySizeException) { | ||
return 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than returning 0, I think it's preferable to report an error through a new telemetry probe.
That being said, if that's too much work, it's probably fine to catch the exception in setExpensiveMetric
and record nothing if it's thrown. Just bump the metric version and change the docs to make it explicit this is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcomella I added a telemetry probe, going to also post data review form and mark this PR with needs:data-review. Let me know if any more changes are needed. TY!
Sorry it took so long to get to this 😞 |
Ideally, we could extend the tests to cover this case as well (I think |
No worries. I know it happens. Thank you for the review! |
0d6a3e7
to
2725aa8
Compare
Request for data collection review formAll questions are mandatory. You must receive review from a data steward peer on your responses to these questions before shipping new data collection.
No.
Note that the data steward reviewing your request will characterize your data collection based on the highest (and most sensitive) category.
All.
Standard telemetry opt-out.
Internally.
No. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. If we want to avoid the churn, I'm happy for this to land without the nits too (after data review). Thanks mcarare !
@@ -25,6 +25,9 @@ private const val FIELD_POS_STARTTIME = 21 // starttime naming matches field in | |||
open class Stat { | |||
|
|||
@VisibleForTesting(otherwise = PRIVATE) | |||
/** | |||
* @throws [java.io.FileNotFoundException] | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think kdoc is conventionally above the annotation
@@ -25,6 +25,9 @@ private const val FIELD_POS_STARTTIME = 21 // starttime naming matches field in | |||
open class Stat { | |||
|
|||
@VisibleForTesting(otherwise = PRIVATE) | |||
/** | |||
* @throws [java.io.FileNotFoundException] | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd add a kdoc to getFrameworkStartNanos
too. It's more important than this method because it's the non-private method of this class
@boek Please data review. |
Codecov Report
@@ Coverage Diff @@
## master #10481 +/- ##
============================================
- Coverage 19.63% 19.63% -0.01%
Complexity 631 631
============================================
Files 363 363
Lines 14950 14953 +3
Branches 2017 2017
============================================
Hits 2936 2936
- Misses 11737 11740 +3
Partials 277 277
Continue to review full report at Codecov.
|
@liuche Please data review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data Review Form (to be filled by Data Stewards)
- Is there or will there be documentation that describes the schema for the ultimate data set in a public, complete, and accurate way?
Yes, documented usage in startup-timeline
ping in metrics.md
- Is there a control mechanism that allows the user to turn the data collection on and off?
Yes, custom pings are controlled by the Fenix data settings
- If the request is for permanent data collection, is there someone who will monitor the data over time?
Expires in 7/2020
-
Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?
Type 1, measuring error frequency when blocked reading from /proc -
Is the data collection request for default-on or default-off?
default on
- Does the instrumentation include the addition of any new identifiers (whether anonymous or otherwise; e.g., username, random IDs, etc. See the appendix for more details)?
No
- Is the data collection covered by the existing Firefox privacy notice?
yes
- Does there need to be a check-in in the future to determine whether to renew the data? (Yes/No) (If yes, set a todo reminder or file a bug if appropriate)**
No, has expiry
- Does the data collection use a third-party collection tool? If yes, escalate to legal.
No
Pull Request checklist
After merge
To download an APK when reviewing a PR: