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 29, 2015
1 parent 1c70342 commit 000ee54
Show file tree
Hide file tree
Showing 4 changed files with 20 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 @@ -62,6 +62,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 @@ -81,6 +81,7 @@ public slots:
void onTimerExpiry();
void triggerGc();
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 @@ -68,6 +68,7 @@ void ActionToolbar::setupSubscriber()
subscriber, SLOT(startListening(QString, QString)));
connect(this, SIGNAL(triggerGc()), subscriber, SLOT(triggerGc()));
connect(this, SIGNAL(takeSnapshot()), subscriber, SLOT(takeSnapshot()));
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 @@ -152,6 +153,13 @@ void ActionToolbar::setupToolBar()
"stop_cpu_profiling",
QIcon(":/icons/Compare-32.png"),
"cpu_profiling");

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 @@ -160,6 +168,10 @@ void ActionToolbar::performGCAction()
emit triggerGc();
}

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 @@ -51,15 +51,18 @@ class ActionToolbar : public QObject
QToolButton *gcButton;
QToolButton *connectButton;
QToolButton *snapshotButton;
QToolButton *cpusnapshotButton;
QToolButton *compareSnapshotButton;
signals:
void connectToSocket(QString commandSocket, QString eventSocket);
void triggerGc();
void disconnectSubscriber();
void takeSnapshot();
void startCPUSnapshot();
public slots:
void performGCAction();
void takeSnapshotAction();
void performCPUSnapshot();
void attemptConnection();
void compareSnapshots();
void useSelectedHost(QString commandSocket, QString eventSocket);
Expand Down

0 comments on commit 000ee54

Please sign in to comment.