forked from qt-creator/qt-creator
ProjectExplorer: measure toolchain auto detection time
Change-Id: I1c0be35b6119c126f1554475f0a96c34ef14c43c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -12,11 +12,16 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
static Q_LOGGING_CATEGORY(Log, "qtc.projectexplorer.toolchain.autodetection", QtWarningMsg)
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// ToolChainSettingsUpgraders:
|
||||
// --------------------------------------------------------------------
|
||||
@@ -49,8 +54,12 @@ struct ToolChainOperations
|
||||
static Toolchains autoDetectToolChains(const ToolchainDetector &detector)
|
||||
{
|
||||
Toolchains result;
|
||||
for (ToolChainFactory *f : ToolChainFactory::allToolChainFactories())
|
||||
for (ToolChainFactory *f : ToolChainFactory::allToolChainFactories()) {
|
||||
QElapsedTimer et;
|
||||
et.start();
|
||||
result.append(f->autoDetect(detector));
|
||||
qCDebug(Log) << f->displayName() << "auto detection took: " << et.elapsed() << "ms";
|
||||
}
|
||||
|
||||
// Remove invalid toolchains that might have sneaked in.
|
||||
return Utils::filtered(result, [](const ToolChain *tc) { return tc->isValid(); });
|
||||
|
||||
Reference in New Issue
Block a user