Commit Graph

8 Commits

Author SHA1 Message Date
Valentin Shergin eadc2ac493 Fabric: Improving precision and type-safety of Telemetry
Summary:
Collecting Telemetry is a crucial part of building a performant UI framework; we do that but we need to improve it to make the data more reliable, actionable and trustful.

Now we collect time points as the number of milliseconds from the start of the CLOCK_MONOTONIC epoch. That's fine but it also has problems:
Sometimes a millisecond is an eternity. We have only 16 (or fewer) of them on each frame. What if some operation takes 1ms (according to telemetry) but we have to run it a dozen times? Does it mean that it's 12 ms in total? So, we lack precision.
This is not type-safe. Do you know how many milliseconds in a microsecond? I don't. We multiply that on magical constants hoping that we copied that from some other place right.
The current implementation is not cross-platform. We have ifdefs for iOS and Android and Unix and Windows (which is now implemented).

So, this diff replaces that with using `std::chrono` which is part of the standard library that designed to fix all those concerns. We also define our type-aliases on top of that to express our concrete constrains:
We use `std::chrono::steady_clock` as the base clock which is according to the standard using `clock_gettime(CLOCK_MONOTONIC, ... )` if available. So, it's fast and compatible (the same under the hood) with Android infra.
We use nanoseconds when we store time durations (TelemetryDuration type).
 Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D19184569

fbshipit-source-id: 7a44688f4bb3bfc6e3009874f0075c531c8569a1
2020-01-27 13:26:49 -08:00
Valentin Shergin 89add2582d Fabric: Collecting mounting time inside MountingTelemetry
Summary:
Now we also collect mounting time inside MountingTelemetry.
We will use it soon.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D18285826

fbshipit-source-id: 512fc62c210a111614b0defb0d76cbd6228fe89f
2019-11-04 18:21:13 -08:00
Valentin Shergin 2690e7363c Fabric: Cross-platform implementation of monotonicTimeInMilliseconds
Summary:
Now the function supports iOS.
We will use it soon.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D18285828

fbshipit-source-id: b9c16433e9c75ab4c071e4bd55074757372f6c0a
2019-11-04 18:21:12 -08:00
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
Joshua Gross c075a240cd Granularly track perf of Fabric
Summary: Enable granular perf measurements under Fabric.

Reviewed By: mdvacca

Differential Revision: D16021797

fbshipit-source-id: c25a8f7cebf53abfcfc39c8f6d50900813214abb
2019-07-20 01:57:20 -07:00
Joshua Gross e5c96a85fc Fix layoutTime calculation
Summary: LayoutTime calculation is also trivially wrong. Quick fix.

Reviewed By: shergin

Differential Revision: D15725167

fbshipit-source-id: b06672b9df9cbaa6c54aa97a4c0b58a43f70d5b2
2019-06-07 17:20:26 -07:00
Joshua Gross 920d9dea21 Fix typo in layout time
Summary: Fix typo.

Reviewed By: shergin

Differential Revision: D15639194

fbshipit-source-id: 1e1d029aab2a7016c630c7429815531e63f71333
2019-06-04 19:21:24 -07:00
Valentin Shergin 4803cab8c4 Fabric: MountingTelemetry and refinments in TimeUtils
Summary: This diff implements encapsulating all time metrics in a single class for better extensibility and readability.

Reviewed By: JoshuaGross

Differential Revision: D15179835

fbshipit-source-id: 62bdf94435a0d37a87ad9bad613cc8e38043a235
2019-05-03 15:11:34 -07:00