X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.cpp;fp=src%2Fcore%2Fcoresession.cpp;h=f4196b0a7058532b17f249fc5717b03f4f9eb5c1;hp=119d73d732e9ba060ee3d4fbcc8bb983151b7944;hb=8f92b3f08df9f4eb8fd243ccec6aa9d4b563ec23;hpb=dc0cc8130d64a74df07a133bc1cc457ab12bb7a0 diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 119d73d7..f4196b0a 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -82,6 +82,7 @@ CoreSession::CoreSession(UserId uid, bool restoreState, bool strictIdentEnabled, , _processMessages(false) , _ignoreListManager(this) , _highlightRuleManager(this) + , _metricsServer(Core::instance()->metricsServer()) { SignalProxy* p = signalProxy(); p->setHeartBeatInterval(30); @@ -151,6 +152,10 @@ CoreSession::CoreSession(UserId uid, bool restoreState, bool strictIdentEnabled, restoreSessionState(); emit initialized(); + + if (_metricsServer) { + _metricsServer->addSession(user(), Core::instance()->strictSysIdent(_user)); + } } void CoreSession::shutdown() @@ -171,6 +176,10 @@ void CoreSession::shutdown() // Nothing to do, suicide so the core can shut down deleteLater(); } + + if (_metricsServer) { + _metricsServer->removeSession(user()); + } } void CoreSession::onNetworkDisconnected(NetworkId networkId) @@ -257,6 +266,10 @@ void CoreSession::addClient(RemotePeer* peer) _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData()); signalProxy()->setTargetPeer(nullptr); + + if (_metricsServer) { + _metricsServer->addClient(user()); + } } void CoreSession::addClient(InternalPeer* peer) @@ -271,6 +284,10 @@ void CoreSession::removeClient(Peer* 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 CoreSession::persistentChannels(NetworkId id) const