git-svn-id: svn://db.shs.com.ru/pip@803 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-06-22 14:55:23 +00:00
parent 71128017dd
commit fb44b01c0f
24 changed files with 433 additions and 142 deletions

View File

@@ -18,11 +18,33 @@
*/
#include "piintrospection_server.h"
#include "piintrospection_server_p.h"
#include "pichunkstream.h"
PRIVATE_DEFINITION_START(PIIntrospectionServer)
PIIntrospection::ProcessInfo process_info;
PRIVATE_DEFINITION_END(PIIntrospectionServer)
PIIntrospectionServer::PIIntrospectionServer(): PIPeer(genName()) {
CONNECTU(&itimer, tickEvent, this, timerEvent)
itimer.start(100);
PRIVATE->process_info = PIIntrospection::getInfo();
CONNECTU(&itimer, tickEvent, this, timerEvent);
}
PIIntrospectionServer::~PIIntrospectionServer() {
itimer.stop(false);
if (!itimer.waitForFinish(1000)) {
PIINTROSPECTION_CONTAINERS->p->mutex.unlock();
}
PIPeer::stop();
}
void PIIntrospectionServer::start() {
itimer.start(1000);
PIPeer::start();
}
@@ -33,10 +55,13 @@ PIString PIIntrospectionServer::genName() {
void PIIntrospectionServer::timerEvent() {
PIChunkStream cs;
cs.add(1, PIIntrospection::packInfo())
.add(2, PIIntrospection::packContainers())
.add(3, PIIntrospection::packThreads())
.add(4, PIIntrospection::packObjects());
PIByteArray ba;
/* PIINTROSPECTION_THREADS->mutex.lock();
ba << appname << *(PIINTROSPECTION_CONTAINERS) << PIINTROSPECTION_THREADS->threads.values();
PIINTROSPECTION_THREADS->mutex.unlock();*/
//piCout << "send" << appname;
ba << PIIntrospection::sign;
ba.append(cs.data());
send("__introspection_client__", ba);
}