Added some debug text to check stats coming through.
This commit is contained in:
parent
49cae23086
commit
62cd774288
2 changed files with 2 additions and 0 deletions
|
@ -255,6 +255,7 @@ namespace Buffer{
|
||||||
}
|
}
|
||||||
if (StatsSocket.connected()){
|
if (StatsSocket.connected()){
|
||||||
StatsSocket.write(Storage.toStyledString());
|
StatsSocket.write(Storage.toStyledString());
|
||||||
|
std::cout << "Wrote stats to controller!" << std::endl;
|
||||||
Storage["log"].clear();
|
Storage["log"].clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -450,6 +450,7 @@ int main(int argc, char ** argv){
|
||||||
if (it->Received() != ""){
|
if (it->Received() != ""){
|
||||||
size_t newlines = it->Received().find("\n\n");
|
size_t newlines = it->Received().find("\n\n");
|
||||||
while (newlines != std::string::npos){
|
while (newlines != std::string::npos){
|
||||||
|
Log("STAT", "Received stats from a buffer");
|
||||||
if (!JsonParse.parse(it->Received().substr(0, newlines), Request, false)){
|
if (!JsonParse.parse(it->Received().substr(0, newlines), Request, false)){
|
||||||
if (Request.isMember("totals") && Request["totals"].isMember("buffer")){
|
if (Request.isMember("totals") && Request["totals"].isMember("buffer")){
|
||||||
std::string thisbuffer = Request["totals"]["buffer"].asString();
|
std::string thisbuffer = Request["totals"]["buffer"].asString();
|
||||||
|
|
Loading…
Add table
Reference in a new issue