Skip to content

Commit

Permalink
Migrates off getInstrumentedStats' deprecated fields
Browse files Browse the repository at this point in the history
Summary:
This diffs replaces uses of the deprecated fields from HermesInternal.getInstrumentedStats() with the ones from Hermes' TimedRuntime.

Changelog:
[General][Added] - JSITimerInternal descriptor

Reviewed By: rubennorte

Differential Revision: D36625701

fbshipit-source-id: fbdb554e5cfb0b3556fcbe01f9e2930ace66a619
  • Loading branch information
jpporto authored and facebook-github-bot committed Jul 7, 2022
1 parent 649d3f0 commit c37f719
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions flow/JSITimerInternalType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/

// Declarations for functionality exposed by Hermes' TimerStats decorator.
//
// For backwards-compatibility, code that uses such functionality must also
// check explicitly at run-time whether the object(s) and method(s) exist, and
// fail safely if not.

/**
* JSITimerInternalType is the global object installed by Hermes' TimedRuntime
* decorator, and it is used to extract runtime timing information.
*/
declare type $JSITimerInternalType = {
/**
* Returns the counters that TimedRuntime keep track.
* There are no guarantees about what keys exist in it, but they can be
* printed for informational purposes.
* @return An object that maps strings to various types of performance
* statistics.
*/
+getTimes?: () => {[string]: number | string, ...},
};

0 comments on commit c37f719

Please sign in to comment.