, _processMessages(false)
, _ignoreListManager(this)
, _highlightRuleManager(this)
+ , _metricsServer(Core::instance()->metricsServer())
{
SignalProxy* p = signalProxy();
p->setHeartBeatInterval(30);
restoreSessionState();
emit initialized();
+
+ if (_metricsServer) {
+ _metricsServer->addSession(user(), Core::instance()->strictSysIdent(_user));
+ }
}
void CoreSession::shutdown()
// Nothing to do, suicide so the core can shut down
deleteLater();
}
+
+ if (_metricsServer) {
+ _metricsServer->removeSession(user());
+ }
}
void CoreSession::onNetworkDisconnected(NetworkId networkId)
_coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
signalProxy()->setTargetPeer(nullptr);
+
+ if (_metricsServer) {
+ _metricsServer->addClient(user());
+ }
}
void CoreSession::addClient(InternalPeer* peer)
if (p)
qInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
_coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
+
+ if (_metricsServer) {
+ _metricsServer->removeClient(user());
+ }
}
QHash<QString, QString> CoreSession::persistentChannels(NetworkId id) const