firefox-devtools/profiler

Fix the types of some of the ProfilerOverheadStats object fields

开放

#2,856 创建于 2020年10月8日

 (23 条评论) (0 个反应) (0 位负责人)TypeScript (486 个派生)auto 404
code maintenancehelp wantedready

仓库指标

星标
 (1,515 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

We have a type for Overhead statistics, and all its values are Microseconds right now: https://github.com/firefox-devtools/profiler/blob/dcb8c42af81c7ee6f14c1fa5be9881dc5d03c115/src/types/profile.js#L459-L482

But some of it's values are not actually Microseconds. For example samplingCount is just a number and overheadPercentage is a percentage. So we should fix these types to reflect the actual values. For percentage, since we don't have a Percentage type, we need to create that type under the InnerWindowID and will look pretty similar since it's also going to use the number esentially: https://github.com/firefox-devtools/profiler/blob/dcb8c42af81c7ee6f14c1fa5be9881dc5d03c115/src/types/profile.js#L31

After making these changes, you should make sure flow and linter is happy by running yarn flow and yarn lint-js.

┆Issue is synchronized with this Jira Task

贡献者指南