NCBI C++ ToolKit
ns_statistics_counters.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef NETSCHEDULE_STATISTICS_COUNTERS__HPP
2 #define NETSCHEDULE_STATISTICS_COUNTERS__HPP
3 
4 /* $Id: ns_statistics_counters.hpp 84210 2018-10-25 15:29:28Z satskyse $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Denis Vakatov (design), Sergey Satskiy (implementation)
30  *
31  * File Description: NetSchedule statistics counters
32  *
33  */
34 
35 #include "background_host.hpp"
36 
38 
39 class CDiagContext_Extra;
40 
41 
42 
43 // Each queue has this set of counters.
44 // The counters are never reset, they are only increased.
46 {
47 public:
48  // The Pending(Done) state can be reached via 3 ways:
49  // - RETURN (RDRB) received
50  // - Timeout has happened
51  // - FPUT (FRED) received.
52  // So, to separate the cases, the ETransitionPathOption is introduced
54  eNone = 0, // Basically, no timeout, no fail. Normal case for
55  // the vast majority of the transitions.
56  eTimeout = 1,
57  eFail = 2,
58  eClear = 3,
59  eNewSession = 4
60  };
61 
65  };
66 
68 
69  void PrintTransitions(CDiagContext_Extra & extra) const;
70  void PrintDelta(CDiagContext_Extra & extra,
71  const CStatisticsCounters & prev) const;
72  string PrintTransitions(void) const;
75  ETransitionPathOption path_option = eNone);
77  size_t count);
78  void CountDBDeletion(size_t count);
79  void CountSubmit(size_t count);
80  void CountNSSubmitRollback(size_t count);
81  void CountNSGetRollback(size_t count);
82  void CountNSReadRollback(size_t count);
83  void CountOutdatedPick(ECommandGroup cmd_group);
84  void CountToPendingWithoutBlacklist(size_t count);
85  void CountToPendingRescheduled(size_t count);
89 
90  static void PrintServerWide(size_t affinities);
91 
92 private:
93  static string x_GetTransitionCounterName(size_t index_from,
94  size_t index_to);
95 
96 private:
98 
99  // +1 is for eDeleted
107 
108  // There are some special counters:
131 
134 
135  // REDO related counters
141 
142  // REREAD related counters
152 };
153 
154 
156 
157 #endif /* NETSCHEDULE_STATISTICS_COUNTERS__HPP */
158 
CAtomicCounter_WithAutoInit –.
Definition: ncbicntr.hpp:120
Temporary object for holding extra message arguments.
Definition: ncbidiag.hpp:1828
void CountNSGetRollback(size_t count)
CAtomicCounter_WithAutoInit m_SubmitCounter
void CountOutdatedPick(ECommandGroup cmd_group)
CAtomicCounter_WithAutoInit m_CancelToDoneJobReread
void CountDBDeletion(size_t count)
CAtomicCounter_WithAutoInit m_PickedAsPendingOutdated
CAtomicCounter_WithAutoInit m_ToCanceledDueToReadNewSessionCounter
CAtomicCounter_WithAutoInit m_ReadFailedToCancelJobReread
CAtomicCounter_WithAutoInit m_ToDoneDueToFailCounter
CAtomicCounter_WithAutoInit m_FromReadFailedJobRedo
CStatisticsCounters(ECountersScope scope)
CAtomicCounter_WithAutoInit m_ToFailedDueToReadTimeoutCounter
CAtomicCounter_WithAutoInit m_ToFailedDueToNewSessionCounter
CAtomicCounter_WithAutoInit m_ToFailedDueToTimeoutCounter
string PrintTransitions(void) const
void CountRedo(CNetScheduleAPI::EJobStatus from)
CAtomicCounter_WithAutoInit m_ToPendingDueToFailCounter
CAtomicCounter_WithAutoInit m_ConfirmedToFailedJobReread
static string x_GetTransitionCounterName(size_t index_from, size_t index_to)
CAtomicCounter_WithAutoInit m_ReadFailedToDoneJobReread
CAtomicCounter_WithAutoInit m_ToPendingWithoutBlacklist
CAtomicCounter_WithAutoInit m_ToCanceledDueToReadClearCounter
CAtomicCounter_WithAutoInit m_NSReadRollbackCounter
CAtomicCounter_WithAutoInit m_ToReadFailedDueToClearCounter
CAtomicCounter_WithAutoInit m_ToDoneDueToNewSessionCounter
CAtomicCounter_WithAutoInit m_FromDoneJobRedo
void CountToPendingRescheduled(size_t count)
CAtomicCounter_WithAutoInit m_ToDoneDueToTimeoutCounter
CAtomicCounter_WithAutoInit m_ConfirmedToCancelJobReread
CAtomicCounter_WithAutoInit m_CancelToCancelJobReread
CAtomicCounter_WithAutoInit m_ToFailedDueToClearCounter
void CountReread(CNetScheduleAPI::EJobStatus from, CNetScheduleAPI::EJobStatus to)
CAtomicCounter_WithAutoInit m_NSSubmitRollbackCounter
void CountTransitionToDeleted(CNetScheduleAPI::EJobStatus from, size_t count)
CAtomicCounter_WithAutoInit m_DBDeleteCounter
void CountTransition(CNetScheduleAPI::EJobStatus from, CNetScheduleAPI::EJobStatus to, ETransitionPathOption path_option=eNone)
CAtomicCounter_WithAutoInit m_ToReadFailedDueToNewSessionCounter
CAtomicCounter_WithAutoInit m_Transitions[g_ValidJobStatusesSize][g_ValidJobStatusesSize+1]
CAtomicCounter_WithAutoInit m_ConfirmedToDoneJobReread
void CountNSSubmitRollback(size_t count)
static void PrintServerWide(size_t affinities)
CAtomicCounter_WithAutoInit m_ToFailedDueToReadNewSessionCounter
CAtomicCounter_WithAutoInit m_ToReadFailedDueToTimeoutCounter
void PrintDelta(CDiagContext_Extra &extra, const CStatisticsCounters &prev) const
CAtomicCounter_WithAutoInit m_ToPendingRescheduled
CAtomicCounter_WithAutoInit m_ToPendingDueToClearCounter
CAtomicCounter_WithAutoInit m_ToFailedDueToReadClearCounter
void CountToPendingWithoutBlacklist(size_t count)
void CountNSReadRollback(size_t count)
CAtomicCounter_WithAutoInit m_ToDoneDueToClearCounter
CAtomicCounter_WithAutoInit m_FromCanceledJobRedo
CAtomicCounter_WithAutoInit m_PickedAsReadOutdated
CAtomicCounter_WithAutoInit m_FromFailedJobRedo
CAtomicCounter_WithAutoInit m_CancelToFailedJobReread
CAtomicCounter_WithAutoInit m_ReadFailedToFailedJobReread
CAtomicCounter_WithAutoInit m_ToPendingDueToNewSessionCounter
CAtomicCounter_WithAutoInit m_FromConfirmedJobRedo
CAtomicCounter_WithAutoInit m_ToCanceledDueToReadTimeoutCounter
CAtomicCounter_WithAutoInit m_ToPendingDueToTimeoutCounter
void CountSubmit(size_t count)
CAtomicCounter_WithAutoInit m_NSGetRollbackCounter
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
Definition: dlist.tmpl.h:61
EJobStatus
Job status codes.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const size_t g_ValidJobStatusesSize
Definition: job_status.hpp:64
ECommandGroup
Definition: ns_types.hpp:54
Modified on Wed May 22 11:30:24 2024 by modify_doxy.py rev. 669887