Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #174 #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rbkit-lib/subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ void Subscriber::takeSnapshot()
commandSocket->sendCommand(triggerSnapshot);
}

void Subscriber::startCPUSnapshot() {
qDebug() <<"Start CPU Snapshot command received";
}

void Subscriber::startSubscriber()
{
qDebug() << "** (start subscriber) Thread id is : " << QThread::currentThreadId();
Expand Down
1 change: 1 addition & 0 deletions rbkit-lib/subscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public slots:
void startCPUProfiling();
void stopCPUProfiling();
void takeSnapshot();
void startCPUSnapshot();
void startSubscriber();

private:
Expand Down
12 changes: 12 additions & 0 deletions rbkit-lib/ui/actiontoolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void ActionToolbar::setupSubscriber()
connect(this, SIGNAL(takeSnapshot()), subscriber, SLOT(takeSnapshot()));
connect(this, SIGNAL(startCPUProfiling()), subscriber, SLOT(startCPUProfiling()));
connect(this, SIGNAL(stopCPUProfiling()), subscriber, SLOT(stopCPUProfiling()));
connect(this, SIGNAL(startCPUSnapshot()), subscriber, SLOT(startCPUSnapshot()));

connect(subscriber, &Subscriber::errored, centralWidget, &CentralWidget::onError);
connect(subscriber, &Subscriber::connected, this, &ActionToolbar::connectedToSocket);
Expand Down Expand Up @@ -156,8 +157,15 @@ void ActionToolbar::setupToolBar()
"stop_cpu_profiling",
QIcon(":/icons/Compare-32.png"),
"cpu_profiling");

connect(stopCPUButton, &QToolButton::clicked, this, &ActionToolbar::performStopCPUAction);

cpusnapshotButton = toolBar->addRibbonAction("Take Snapshot",
"start_snapshot",
QIcon(":/icons/snapshot-32.png"),
"cpu_profiling");
connect(cpusnapshotButton, &QToolButton::clicked, this, &ActionToolbar::performCPUSnapshot);

toolBar->loadStyleSheet(":/icons/style.css");
}

Expand All @@ -174,6 +182,10 @@ void ActionToolbar::performStopCPUAction() {
emit stopCPUProfiling();
}

void ActionToolbar::performCPUSnapshot() {
emit startCPUSnapshot();
}

void ActionToolbar::takeSnapshotAction()
{
if (centralWidget->attemptMemorySnapshot()) {
Expand Down
3 changes: 3 additions & 0 deletions rbkit-lib/ui/actiontoolbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ActionToolbar : public QObject
QToolButton *stopCPUButton;
QToolButton *connectButton;
QToolButton *snapshotButton;
QToolButton *cpusnapshotButton;
QToolButton *compareSnapshotButton;
signals:
void connectToSocket(QString commandSocket, QString eventSocket);
Expand All @@ -61,11 +62,13 @@ class ActionToolbar : public QObject
void stopCPUProfiling();
void disconnectSubscriber();
void takeSnapshot();
void startCPUSnapshot();
public slots:
void performGCAction();
void performStartCPUAction();
void performStopCPUAction();
void takeSnapshotAction();
void performCPUSnapshot();
void attemptConnection();
void compareSnapshots();
void useSelectedHost(QString commandSocket, QString eventSocket);
Expand Down