MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / beginProfilingImpl

Method beginProfilingImpl

launcher/tools/JProfiler.cpp:50–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void JProfiler::beginProfilingImpl(shared_qobject_ptr<LaunchTask> process)
51{
52 listeningPort = globalSettings->get("JProfilerPort").toInt();
53 QProcess *profiler = new QProcess(this);
54 QStringList profilerArgs =
55 {
56 "-d", QString::number(process->pid()),
57 "--gui",
58 "-p", QString::number(listeningPort)
59 };
60 auto basePath = globalSettings->get("JProfilerPath").toString();
61
62#ifdef Q_OS_WIN
63 QString profilerProgram = QDir(basePath).absoluteFilePath("bin/jpenable.exe");
64#else
65 QString profilerProgram = QDir(basePath).absoluteFilePath("bin/jpenable");
66#endif
67
68 profiler->setArguments(profilerArgs);
69 profiler->setProgram(profilerProgram);
70
71 connect(profiler, SIGNAL(started()), SLOT(profilerStarted()));
72 connect(profiler, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(profilerFinished(int,QProcess::ExitStatus)));
73
74 m_profilerProcess = profiler;
75 profiler->start();
76}
77
78void JProfilerFactory::registerSettings(SettingsObjectPtr settings)
79{

Callers

nothing calls this directly

Calls 5

pidMethod · 0.80
QDirClass · 0.50
getMethod · 0.45
toStringMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected