diff --git a/Libraries/Inspector/Inspector.js b/Libraries/Inspector/Inspector.js
index fa6e20e08..6b1ac5789 100644
--- a/Libraries/Inspector/Inspector.js
+++ b/Libraries/Inspector/Inspector.js
@@ -26,6 +26,7 @@ class Inspector extends React.Component {
this.state = {
panelPos: 'bottom',
inspecting: true,
+ perfing: false,
inspected: null,
};
}
@@ -59,9 +60,18 @@ class Inspector extends React.Component {
});
}
+ setPerfing(val: bool) {
+ this.setState({
+ perfing: val,
+ inspecting: false,
+ inspected: null,
+ });
+ }
+
setInspecting(val: bool) {
this.setState({
inspecting: val,
+ inspected: null
});
}
@@ -79,6 +89,8 @@ class Inspector extends React.Component {
);
+ } else if (this.props.perfing) {
+ contents = (
+
+ );
} else {
contents = (
@@ -58,7 +63,12 @@ class InspectorPanel extends React.Component {
);
@@ -69,6 +79,8 @@ InspectorPanel.propTypes = {
inspecting: PropTypes.bool,
setInspecting: PropTypes.func,
inspected: PropTypes.object,
+ perfing: PropTypes.bool,
+ setPerfing: PropTypes.func,
};
class Button extends React.Component {
diff --git a/Libraries/Inspector/PerformanceOverlay.js b/Libraries/Inspector/PerformanceOverlay.js
new file mode 100644
index 000000000..c0be51242
--- /dev/null
+++ b/Libraries/Inspector/PerformanceOverlay.js
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2015-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule PerformanceOverlay
+ * @flow
+ */
+'use strict';
+
+var PerformanceLogger = require('PerformanceLogger');
+var React = require('React');
+var StyleSheet = require('StyleSheet');
+var Text = require('Text');
+var View = require('View');
+
+var PerformanceOverlay = React.createClass({
+ render: function() {
+ var perfLogs = PerformanceLogger.getTimespans();
+ var items = [];
+
+ for (var key in perfLogs) {
+ if (perfLogs[key].totalTime) {
+ items.push(
+
+ {key}
+
+ {perfLogs[key].totalTime + 'ms'}
+
+
+ );
+ }
+ }
+
+ return (
+
+ {items}
+
+ );
+ }
+});
+
+var styles = StyleSheet.create({
+ container: {
+ height: 100,
+ paddingTop: 10,
+ },
+ label: {
+ flex: 1,
+ },
+ row: {
+ flexDirection: 'row',
+ paddingHorizontal: 10,
+ },
+ text: {
+ color: 'white',
+ fontSize: 12,
+ },
+ totalTime: {
+ paddingRight: 100,
+ },
+});
+
+module.exports = PerformanceOverlay;