-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprofiler-conductor.hh
102 lines (80 loc) · 2.75 KB
/
profiler-conductor.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef PROFILER_CONDUCTOR_HH
#define PROFILER_CONDUCTOR_HH
#include <QCheckBox>
#include <QMainWindow>
#include <QStandardItemModel>
#include <QTreeWidget>
#include <memory>
#include <unordered_map>
#include "executiontree.hh"
#include <utility>
class WebscriptView;
class GistMainWindow;
class NodeTree;
class Data;
class CmpTreeDialog;
class ProfilerTcpServer;
class ExecutionInfo {
public:
WebscriptView* sunburstView = nullptr;
WebscriptView* icicleView = nullptr;
WebscriptView* variablesView = nullptr;
GistMainWindow* gistWindow = nullptr;
CmpTreeDialog* cmpTreeDialog = nullptr;
};
class ProfilerConductor : public QMainWindow {
Q_OBJECT
private:
QList<Execution*> executions;
QHash<const Execution*, ExecutionInfo> executionInfoHash;
quint16 listen_port;
ExecutionTreeModel executionTreeModel;
QTreeView executionTreeView;
QCheckBox compareWithLabelsCB;
QHash<int, MetaExecution> executionMetadata;
/// NOTE(maxim): This is a bit hacky
Execution* latest_execution = nullptr;
std::unique_ptr<ProfilerTcpServer> listener;
void addExecution(Execution& execution);
void arrangeExecutions(void);
void displayExecution(Execution& execution, QString&& title);
GistMainWindow* createGist(Execution&, QString title);
WebscriptView* getWebscriptView(Execution* execution, std::string id);
void registerWebscriptView(Execution* execution, std::string id, WebscriptView* webView);
QVector<Execution*> getSelectedExecutions() const;
void tellVisualisationsSelectNode(Execution* execution, int gid);
void tellVisualisationsSelectManyNodes(Execution* execution, QList<QVariant> gids);
private slots:
void gistButtonClicked();
void compareButtonClicked();
void compareSubtrees();
void gatherStatisticsClicked();
void webscriptClicked();
void saveExecutionClicked();
void loadExecutionClicked();
void deleteExecutionClicked();
void createDebugExecution();
void updateTitles();
void cloneExecution();
void executionIdReady(Execution* e);
void executionStarted(Execution* e);
public:
ProfilerConductor();
~ProfilerConductor();
int getNextExecId(const std::string& group_name,
const std::string& execution_name,
const NameMap& nameMap);
int getListenPort();
void loadExecution(std::string filename);
void createExecution(std::unique_ptr<NodeTree> nt, std::unique_ptr<Data>);
void autoCompareTwoExecution();
Q_SIGNALS:
void showNodeInfo(std::string extra_info);
void showNogood(QString heatmap, QString text, bool record);
void searchLogReady(const QString& path);
public Q_SLOTS:
void showNodeInfoToIDE(std::string extra_info);
void showNogoodToIDE(QString heatmap, QString text, bool record);
void emitSearchLogReady(const QString& path);
};
#endif