mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
bc3251c6a5
Summary: Just renaming, nothing more. The idea of MountingTelemetry already grown to something bigger than just mounting telemetry, so we are renaming it. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D23374947 fbshipit-source-id: f60ce38b75d1ce77498b84688e59598314c69a78
68 lines
1.7 KiB
C++
68 lines
1.7 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <better/small_vector.h>
|
|
#include <vector>
|
|
|
|
#include <react/renderer/mounting/TransactionTelemetry.h>
|
|
#include <react/utils/Telemetry.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* Represents telemetry data associated with a particular running Surface.
|
|
* Contains information aggregated from multiple completed transaction.
|
|
*/
|
|
class SurfaceTelemetry final {
|
|
public:
|
|
constexpr static size_t kMaxNumberOfRecordedCommitTelemetries = 16;
|
|
|
|
/*
|
|
* Metrics
|
|
*/
|
|
TelemetryDuration getLayoutTime() const;
|
|
TelemetryDuration getCommitTime() const;
|
|
TelemetryDuration getDiffTime() const;
|
|
TelemetryDuration getMountTime() const;
|
|
|
|
int getNumberOfTransactions() const;
|
|
int getNumberOfMutations() const;
|
|
int getNumberOfTextMeasurements() const;
|
|
int getLastRevisionNumber() const;
|
|
|
|
std::vector<TransactionTelemetry> getRecentTransactionTelemetries() const;
|
|
|
|
/*
|
|
* Incorporate data from given transaction telemetry into aggregated data
|
|
* for the Surface.
|
|
*/
|
|
void incorporate(
|
|
TransactionTelemetry const &telemetry,
|
|
int numberOfMutations);
|
|
|
|
private:
|
|
TelemetryDuration layoutTime_{};
|
|
TelemetryDuration commitTime_{};
|
|
TelemetryDuration diffTime_{};
|
|
TelemetryDuration mountTime_{};
|
|
|
|
int numberOfTransactions_{};
|
|
int numberOfMutations_{};
|
|
int numberOfTextMeasurements_{};
|
|
int lastRevisionNumber_{};
|
|
|
|
better::
|
|
small_vector<TransactionTelemetry, kMaxNumberOfRecordedCommitTelemetries>
|
|
recentTransactionTelemetries_{};
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|