From c7fdd2701f7edc1a771a04c890da4d742dca6ffb Mon Sep 17 00:00:00 2001 From: Ram N Date: Thu, 26 Jul 2018 15:18:22 -0700 Subject: [PATCH] Added more info to Module Registry systraces Summary: Added module names to systraces for getConstants and getMethods. Also added systrace for moduleNames. We are starting to look at ways to optimize native modules, and having these traces helps Reviewed By: javache Differential Revision: D9012702 fbshipit-source-id: c79222f36988bef3a108ed91d1ea1318d3576b40 --- ReactCommon/cxxreact/ModuleRegistry.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ReactCommon/cxxreact/ModuleRegistry.cpp b/ReactCommon/cxxreact/ModuleRegistry.cpp index 17f17746984809..f897bc300ad29e 100644 --- a/ReactCommon/cxxreact/ModuleRegistry.cpp +++ b/ReactCommon/cxxreact/ModuleRegistry.cpp @@ -41,6 +41,7 @@ void ModuleRegistry::updateModuleNamesFromIndex(size_t index) { } void ModuleRegistry::registerModules(std::vector> modules) { + SystraceSection s_("ModuleRegistry::registerModules"); if (modules_.empty() && unknownModules_.empty()) { modules_ = std::move(modules); } else { @@ -67,6 +68,7 @@ void ModuleRegistry::registerModules(std::vector> } std::vector ModuleRegistry::moduleNames() { + SystraceSection s_("ModuleRegistry::moduleNames"); std::vector names; for (size_t i = 0; i < modules_.size(); i++) { std::string name = normalizeName(modules_[i]->getName()); @@ -106,12 +108,12 @@ folly::Optional ModuleRegistry::getConfig(const std::string& name) folly::dynamic config = folly::dynamic::array(name); { - SystraceSection s_("getConstants"); + SystraceSection s_("ModuleRegistry::getConstants", "module", name); config.push_back(module->getConstants()); } { - SystraceSection s_("getMethods"); + SystraceSection s_("ModuleRegistry::getMethods", "module", name); std::vector methods = module->getMethods(); folly::dynamic methodNames = folly::dynamic::array;