diff --git a/src/bin/parkinglot/ccsession.cc b/src/bin/parkinglot/ccsession.cc index cfb8d20241..1c4e5546bb 100644 --- a/src/bin/parkinglot/ccsession.cc +++ b/src/bin/parkinglot/ccsession.cc @@ -58,3 +58,21 @@ CommandSession::getCommand() { return std::pair("unknown", ""); } + +void +handleStatRequest() +{ + ISC::Data::ElementPtr ep, routing, data; + + session.group_recvmsg(routing, data, false); + ep = data->get("command"); + if (ep != NULL && ep->string_value() == "getstat") { + struct timeval now; + ElementPtr resp = Element::create(std::map()); + gettimeofday(&now, NULL); + resp->set("sent", Element::create(now.tv_sec + + (double)now.tv_usec / 1000000)); + resp->set("counter", Element::create(++counter)); + session.group_sendmsg(resp, "statistics"); + } +}