Start adding state annotations for diagnostic screen

Summary:
The plan is to add such state annotations around all core sonar tasks, so the diagnostic screen can show a useful up to date picture of what's going on.
This is the first batch of such annotaions, to act as a tracer while putting the rest of the diagnostics code in place.

Reviewed By: passy

Differential Revision: D8954014

fbshipit-source-id: 864156b0d3f51eeb05c2c8916c1765e834f1dc8e
This commit is contained in:
John Knox
2018-08-03 07:34:34 -07:00
committed by Facebook Github Bot
parent fb447e4f84
commit c791a108f1
2 changed files with 14 additions and 3 deletions

View File

@@ -42,15 +42,21 @@ class SonarClient : public SonarWebSocket::Callbacks {
SonarClient(std::unique_ptr<SonarWebSocket> socket)
: socket_(std::move(socket)) {
sonarState_ = std::make_unique<SonarState>();
auto step = sonarState_->start("Create client");
socket_->setCallbacks(this);
step->complete();
}
void start() {
auto step = sonarState_->start("Start client");
socket_->start();
step->complete();
}
void stop() {
auto step = sonarState_->start("Stop client");
socket_->stop();
step->complete();
}
void onConnected() override;