Skip to content

Commit

Permalink
issue #174
Browse files Browse the repository at this point in the history
added a perform snapshot button
  • Loading branch information
ishankhare07 committed Jun 30, 2015
1 parent a21581c commit c582c70
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
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
11 changes: 11 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(snapshotButton, &QToolButton::clicked, this, &ActionToolbar::performCPUSnapshot);

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

Expand All @@ -173,6 +181,9 @@ void ActionToolbar::performStartCPUAction() {
void ActionToolbar::performStopCPUAction() {
emit stopCPUProfiling();
}
void ActionToolbar::performCPUSnapshot() {
emit startCPUSnapshot();
}

void ActionToolbar::takeSnapshotAction()
{
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

0 comments on commit c582c70

Please sign in to comment.