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

Unified Diff: tracing/tracing/base/statistics.html

Issue 1992303003: Refactor hazardMetric (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: fixing Created 4 years, 6 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 | « tracing/trace_viewer.gypi ('k') | tracing/tracing/metrics/system_health/hazard_metric.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/statistics.html
diff --git a/tracing/tracing/base/statistics.html b/tracing/tracing/base/statistics.html
index b272a03f35a078b731a98cbacfee4cb934a7d256..4c27c4936bf15d28f4f764c912d9fba6460f98e6 100644
--- a/tracing/tracing/base/statistics.html
+++ b/tracing/tracing/base/statistics.html
@@ -705,6 +705,33 @@ tr.exportTo('tr.b', function() {
}
};
+ /**
+ * Instead of describing a LogNormalDistribution in terms of its "location"
+ * and "shape", it can also be described in terms of its median
+ * and the point at which its complementary cumulative distribution
+ * function bends between the linear-ish region in the middle and the
+ * exponential-ish region. When the distribution is used to compute
+ * percentiles for log-normal random processes such as latency, as the latency
+ * improves, it hits a point of diminishing returns, when it becomes
+ * relatively difficult to improve the score further. This point of
+ * diminishing returns is the first x-intercept of the third derivative of the
+ * CDF, which is the second derivative of the PDF.
+ *
+ * https://www.desmos.com/calculator/cg5rnftabn
+ *
+ * @param {number} median The median of the distribution.
+ * @param {number} diminishingReturns The point of diminishing returns.
+ * @return {LogNormalDistribution}
+ */
+ Statistics.LogNormalDistribution.fromMedianAndDiminishingReturns =
+ function(median, diminishingReturns) {
+ diminishingReturns = Math.log(diminishingReturns / median);
+ var shape = Math.sqrt(1 - 3 * diminishingReturns -
+ Math.sqrt(Math.pow(diminishingReturns - 3, 2) - 8)) / 2;
+ var location = Math.log(median);
+ return new Statistics.LogNormalDistribution(location, shape);
+ };
+
return {
Statistics: Statistics
};
« no previous file with comments | « tracing/trace_viewer.gypi ('k') | tracing/tracing/metrics/system_health/hazard_metric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698