Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Unified Diff: tracing/tracing/extras/rail/animation_interaction_record.html

Issue 1357983002: Invert pain to comfort throughout tracing. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tracing/tracing/extras/rail/animation_interaction_record_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/extras/rail/animation_interaction_record.html
diff --git a/tracing/tracing/extras/rail/animation_interaction_record.html b/tracing/tracing/extras/rail/animation_interaction_record.html
index 1313263cf4ada520aa5da502f71bdb55f3f4677d..f30818b57bc49a806131452ec6c9c638c2cd5412 100644
--- a/tracing/tracing/extras/rail/animation_interaction_record.html
+++ b/tracing/tracing/extras/rail/animation_interaction_record.html
@@ -16,16 +16,16 @@ found in the LICENSE file.
* @fileoverview The Animation phase of RAIL.
*/
tr.exportTo('tr.e.rail', function() {
- // The computeNormalizedPain regions are delineated at these FPS values.
- var PAIN_FPS_REGIONS = [60, 40, 30, 10];
+ // The computeNormalizedComfort regions are delineated at these FPS values.
+ var COMFORT_FPS_REGIONS = [60, 40, 30, 10];
// A frame is long if it starts more than this much time after the previous
// frame.
var LONG_FRAME_MS = 50;
- // The computeNormalizedPain regions are delineated at these relative
+ // The computeNormalizedComfort regions are delineated at these relative
// discrepancy values.
- var PAIN_JANK_REGIONS = [0.05, 0.1, 0.2, 0.3];
+ var COMFORT_JANK_REGIONS = [0.05, 0.1, 0.2, 0.3];
function AnimationInteractionRecord(start, duration) {
tr.e.rail.RAILInteractionRecord.call(
@@ -51,35 +51,34 @@ tr.exportTo('tr.e.rail', function() {
return this.frameEvents_;
},
- get normalizedUserPain() {
+ get normalizedUserComfort() {
return tr.e.rail.weightedAverage2(
- this.normalizedJankPain, this.normalizedFPSPain);
+ this.normalizedJankComfort, this.normalizedFPSComfort);
},
- get normalizedFPSPain() {
+ get normalizedFPSComfort() {
var durationSeconds = this.duration / 1000;
- var avgFps = this.frameEvents.length / durationSeconds;
- var avgSpf = 1 / avgFps;
- return tr.e.rail.computeNormalizedPain(avgSpf, {
- minValueExponential: 1 / PAIN_FPS_REGIONS[0],
- minValueLinear: 1 / PAIN_FPS_REGIONS[1],
- minValueLogarithmic: 1 / PAIN_FPS_REGIONS[2],
- maxValue: 1 / PAIN_FPS_REGIONS[3]
+ var avgSpf = durationSeconds / this.frameEvents.length;
+ return 1 - tr.e.rail.computeNormalizedComfort(avgSpf, {
+ minValueExponential: 1 / COMFORT_FPS_REGIONS[0],
+ minValueLinear: 1 / COMFORT_FPS_REGIONS[1],
+ minValueLogarithmic: 1 / COMFORT_FPS_REGIONS[2],
+ maxValue: 1 / COMFORT_FPS_REGIONS[3]
});
},
- get normalizedJankPain() {
+ get normalizedJankComfort() {
var frameTimestamps = this.frameEvents.toArray().map(function(event) {
return event.start;
});
var absolute = false;
var discrepancy = tr.b.Statistics.timestampsDiscrepancy(
frameTimestamps, absolute);
- return tr.e.rail.computeNormalizedPain(discrepancy, {
- minValueExponential: PAIN_JANK_REGIONS[0],
- minValueLinear: PAIN_JANK_REGIONS[1],
- minValueLogarithmic: PAIN_JANK_REGIONS[2],
- maxValue: PAIN_JANK_REGIONS[3]
+ return 1 - tr.e.rail.computeNormalizedComfort(discrepancy, {
+ minValueExponential: COMFORT_JANK_REGIONS[0],
+ minValueLinear: COMFORT_JANK_REGIONS[1],
+ minValueLogarithmic: COMFORT_JANK_REGIONS[2],
+ maxValue: COMFORT_JANK_REGIONS[3]
});
}
};
« no previous file with comments | « no previous file | tracing/tracing/extras/rail/animation_interaction_record_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698