| 1 |
/* |
| 2 |
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. |
| 3 |
* |
| 4 |
* This file is part of the reasoning system Konclude. |
| 5 |
* For details and support, see <http://konclude.com/>. |
| 6 |
* |
| 7 |
* Konclude is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of version 3 of the GNU Lesser General Public |
| 9 |
* License (LGPLv3) as published by the Free Software Foundation. |
| 10 |
* |
| 11 |
* Konclude is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU (Lesser) General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU (Lesser) General Public |
| 17 |
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef KONCLUDE_SCHEDULER_CTASKPROCESSINGSTATISTICS_H |
| 22 |
#define KONCLUDE_SCHEDULER_CTASKPROCESSINGSTATISTICS_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
#include <QVector> |
| 26 |
|
| 27 |
|
| 28 |
// Namespace includes |
| 29 |
#include "SchedulerSettings.h" |
| 30 |
|
| 31 |
// Other includes |
| 32 |
|
| 33 |
// Logger includes |
| 34 |
#include "Logger/CLogger.h" |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
namespace Konclude { |
| 39 |
|
| 40 |
namespace Scheduler { |
| 41 |
|
| 42 |
|
| 43 |
#ifdef KONCLUDE_SCHEDULER_TASK_PROCESSING_STATISTICS |
| 44 |
#define INCTASKPROCESSINGSTAT(a) a |
| 45 |
#else |
| 46 |
#define INCTASKPROCESSINGSTAT(a) |
| 47 |
#endif |
| 48 |
|
| 49 |
/*! |
| 50 |
* |
| 51 |
* \class CTaskProcessingStatistics |
| 52 |
* \author Andreas Steigmiller |
| 53 |
* \version 0.1 |
| 54 |
* \brief TODO |
| 55 |
* |
| 56 |
*/ |
| 57 |
class CTaskProcessingStatistics { |
| 58 |
// public methods |
| 59 |
public: |
| 60 |
//! Constructor |
| 61 |
CTaskProcessingStatistics(); |
| 62 |
|
| 63 |
//! Destructor |
| 64 |
virtual ~CTaskProcessingStatistics(); |
| 65 |
|
| 66 |
CTaskProcessingStatistics* clear(); |
| 67 |
|
| 68 |
|
| 69 |
CTaskProcessingStatistics* incStatisticTasksProcessedCount(cint64 incCount = 1); |
| 70 |
CTaskProcessingStatistics* incStatisticTasksAddedCount(cint64 incCount = 1); |
| 71 |
CTaskProcessingStatistics* incStatisticTasksCreatedCount(cint64 incCount = 1); |
| 72 |
CTaskProcessingStatistics* incStatisticTasksCompletedCount(cint64 incCount = 1); |
| 73 |
CTaskProcessingStatistics* incStatisticTasksUpdatedCount(cint64 incCount = 1); |
| 74 |
CTaskProcessingStatistics* incStatisticEventsProcessedCount(cint64 incCount = 1); |
| 75 |
CTaskProcessingStatistics* incStatisticTasksRequestedCount(cint64 incCount = 1); |
| 76 |
CTaskProcessingStatistics* incStatisticThreadsBlockedCount(cint64 incCount = 1); |
| 77 |
CTaskProcessingStatistics* incStatisticCallbacksExecutedCount(cint64 incCount = 1); |
| 78 |
|
| 79 |
cint64 getStatisticTasksProcessedCount(); |
| 80 |
cint64 getStatisticTasksAddedCount(); |
| 81 |
cint64 getStatisticTasksCreatedCount(); |
| 82 |
cint64 getStatisticTasksCompletedCount(); |
| 83 |
cint64 getStatisticTasksUpdatedCount(); |
| 84 |
cint64 getStatisticEventsProcessedCount(); |
| 85 |
cint64 getStatisticTasksRequestedCount(); |
| 86 |
cint64 getStatisticThreadsBlockedCount(); |
| 87 |
cint64 getStatisticCallbacksExecutedCount(); |
| 88 |
|
| 89 |
|
| 90 |
CTaskProcessingStatistics* incStatisticTasksCreatedDepthCount(cint64 taskDepth, cint64 incCount = 1); |
| 91 |
CTaskProcessingStatistics* incStatisticTasksProcessedDepthCount(cint64 taskDepth, cint64 incCount = 1); |
| 92 |
|
| 93 |
cint64 getStatisticTasksCreatedDepthCount(cint64 taskDepth); |
| 94 |
cint64 getStatisticTasksProcessedDepthCount(cint64 taskDepth); |
| 95 |
|
| 96 |
QVector<cint64>* getStatisticTasksCreatedDepthCountVector(); |
| 97 |
QVector<cint64>* getStatisticTasksProcessedDepthCountVector(); |
| 98 |
|
| 99 |
|
| 100 |
const static cint64 VECCOUNTERSIZE = 10000; |
| 101 |
|
| 102 |
// protected methods |
| 103 |
protected: |
| 104 |
|
| 105 |
// protected variables |
| 106 |
protected: |
| 107 |
cint64 mStatTasksProcessed; |
| 108 |
cint64 mStatTasksAdded; |
| 109 |
cint64 mStatTasksCreated; |
| 110 |
cint64 mStatTasksCompleted; |
| 111 |
cint64 mStatTasksUpdated; |
| 112 |
cint64 mStatEventsProcessed; |
| 113 |
cint64 mStatTasksRequested; |
| 114 |
cint64 mStatThreadBlocked; |
| 115 |
cint64 mStatCallbacksExecuted; |
| 116 |
|
| 117 |
|
| 118 |
QVector<cint64> mTaskCreatedDepthCountVec; |
| 119 |
QVector<cint64> mTaskProcessedDepthCountVec; |
| 120 |
|
| 121 |
|
| 122 |
// private methods |
| 123 |
private: |
| 124 |
|
| 125 |
// private variables |
| 126 |
private: |
| 127 |
|
| 128 |
}; |
| 129 |
|
| 130 |
}; // end namespace Scheduler |
| 131 |
|
| 132 |
}; // end namespace Konclude |
| 133 |
|
| 134 |
#endif // KONCLUDE_SCHEDULER_CTASKPROCESSINGSTATISTICS_H |