Commit 2f34b787 authored by Pavel Vainerman's avatar Pavel Vainerman

(IOC): рефакторинг функции getInfo(), добавил возможность получения

статистики по конкретному заказчику
parent 604c1732
......@@ -588,6 +588,12 @@ uniset::SimpleInfo* <xsl:value-of select="$CLASSNAME"/>_SK::getInfo( const char*
inf &lt;&lt; "LogServer: NONE" &lt;&lt; endl;
<xsl:if test="normalize-space($STAT)='1'">
size_t smCount = 0;
for( const auto&amp; s: smStat )
smCount += s.second;
inf &lt;&lt; "smCount=" &lt;&lt; smCount &lt;&lt; endl;
inf &lt;&lt; "statistics: " &lt;&lt; endl
&lt;&lt; " processingMessageCatchCount: " &lt;&lt; processingMessageCatchCount &lt;&lt; endl;
......
......@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2017-04-29+03:00
// generate timestamp: 2017-04-30+03:00
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#define UObject_SK_H_
......
......@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2017-04-29+03:00
// generate timestamp: 2017-04-30+03:00
// -----------------------------------------------------------------------------
#include <memory>
#include <iomanip>
......@@ -525,6 +525,12 @@ uniset::SimpleInfo* UObject_SK::getInfo( const char* userparam )
inf << "LogServer: NONE" << endl;
size_t smCount = 0;
for( const auto& s: smStat )
smCount += s.second;
inf << "smCount=" << smCount << endl;
inf << "statistics: " << endl
<< " processingMessageCatchCount: " << processingMessageCatchCount << endl;
......
......@@ -293,7 +293,11 @@ namespace uniset
virtual void checkThreshold(IOController::IOStateList::iterator& li, const uniset::ObjectId sid, bool send_msg = true );
//! поиск информации о пороговом датчике
ThresholdExtList::iterator findThreshold( const uniset::ObjectId sid, const uniset::ThresholdId tid );
ThresholdInfoExt* findThreshold( AskThresholdMap& tmap, const uniset::ObjectId sid, const uniset::ThresholdId tid );
// обновление статистики
bool updateThresholdStat( AskThresholdMap& tmap, uniset::ObjectId sid, uniset::ThresholdId tid, const uniset::ConsumerInfo& ci, size_t stat_smCount );
bool updateSensorStat( IOController::IOStateList::iterator& it, const uniset::ConsumerInfo& ci, size_t stat_smCount );
/*! сохранение списка заказчиков
По умолчанию делает dump, если объявлен dumper.
......@@ -331,6 +335,12 @@ namespace uniset
Poco::JSON::Object::Ptr getConsumers(uniset::ObjectId sid, ConsumerListInfo& clist, bool ifNotEmpty = true );
#endif
// статистика
void showStatisticsForConsumer( std::ostringstream& inf, const std::string& consumer );
void showStatisticsForLostConsumers( std::ostringstream& inf );
void showStatisticsForConsusmers( std::ostringstream& inf );
void showStatisticsForConsumersWithLostEvent( std::ostringstream& inf );
private:
friend class NCRestorer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment