summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/resolution/prdfIntervalThresholdResolution.H
blob: 747d8bad1849abe9c68d0c791e07bb5196cbeb95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/framework/resolution/prdfIntervalThresholdResolution.H $ */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2001,2013              */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef prdfIntervalThresholdResolution_H
#define prdfIntervalThresholdResolution_H

/**
 @file prdfIntervalThresholdResolution.H
 @brief Common PRD IntervalThresholdResolution class declairation
*/

// Class Description *************************************************
//
//  Name:  IntervalThresholdResolution
//  Base class: Resolution
//
//  Description: Resolution that has a threshold and keeps track of how
//               many times its called within an interval of time.
//             . When the threshold is reached within that time, it
//               tells the service data collector and sends it a mask id,
//               then resets the threshold count to 0. If the threshold
//               is not reached within the specified interval, the
//               interval is reset with the count at 1.
//  Usage:
//
//  MruCallout callout[] = {PU0};
//  enum { thresholdValue = 32, MaskId = 05 , Minutes = 60 };
//  Time intervalValue = 5 * Minutes;  // Length set to 5 minutes
//  IntervalThresholdResolution itr(thresholdValue,intervalValue,MaskId);
//  FinalResolution fr(callout,1);
//  ResolutionList rl(&itr,&fr);
//  ResolutionMap rm(...);
//  rm.Add(BIT_LIST_STRING_05,&rl);   // Resolution invoked when bit 5
//                                       is on - callsout callout and
//                                       thresholds at thresholdValue
//
// End Class Description *********************************************

//--------------------------------------------------------------------
// Includes
//--------------------------------------------------------------------

#include <prdfThresholdResolutions.H>
#warning this is an obsolite part

#if defined(_OBSOLITE_)

#if !defined(Resolution_h)
 #include <iipThresholdResolution.h>
#endif

#if !defined(PRDFTIMER_H)
 #include <prdfTimer.H>
#endif
//--------------------------------------------------------------------
//  Forward References
//--------------------------------------------------------------------

class IntervalThresholdResolution : public ThresholdResolution
{
public:
  /**
   Constructor
   @param thresholdValue at which threshold is reached
   @param intervalValue length of time window (in seconds)
   @param mask_id value given to the service data at threshold
   @return nothing
   @pre None
   @post Object created
   */
  IntervalThresholdResolution(uint16_t thresholdValue, uint32_t intervalLengthValue, uint32_t mask_id);

  /**
   Constructor
   @param thresholdValue at which threshold is reached
   @param intervalValue length of time window (in seconds)
   @param mask_id value given to the service data at threshold
   @param Resolution to call from this one.
   @return nothing
   @pre None
   @post Object created
   */
//   IntervalThresholdResolution(uint16_t thresholdValue, uint32_t intervalLengthValue, uint32_t mask_id,
//                              Resolution & r);

  // ~IntervalThresholdResolution();
  // Function Specification ********************************************
  //
  // Purpose:      Destruction
  // Parameters:   None.
  // Returns:      No value returned
  // Requirements: None.
  // Promises:     None.
  // Exceptions:   None.
  // Concurrency:  Reentrant
  // Notes:        Compiler default ok
  //
  // End Function Specification ****************************************

  // copy ctor - Compiler default ok
  // Assignment - Compiler default ok

  virtual int32_t Resolve(STEP_CODE_DATA_STRUCT & error);
  // Function Specification ********************************************
  //
  // Purpose:      Resolve service data for a specific error bit
  // Parameters:   Reference to the Step code data structure
  // Returns:      return code
  // Requirements: None
  // Promises:     count++;
  //               if currentTime is past intervalEndTime then
  //                  count = 1
  //                  new intervalEndTime calculated based on currentTime
  //               else if count == threshold then
  //                  error.service_data->IsAtThreshold() == TRUE
  //                  maskId sent to error.service_data
  //                  count = 0
  //               else; // count still remains incremented
  // Exceptions:   None
  // Concurrency:  synchronous
  // Notes:        if rc != SUCCESS then state of service data is unpredictable
  //
  // End Function Specification ****************************************


private:  // functions
private:  // Data

//  uint8_t    threshold; // moved to base class
//  uint8_t    count;
//  uint16_t   maskId;
  uint32_t   intervalLength;
  PrdTimer intervalEndTime;
//  Resolution * xRes;
};

inline
IntervalThresholdResolution::IntervalThresholdResolution(uint16_t thresholdValue,
                                                         uint32_t intervalLengthValue,
                                                         uint32_t mask_id)
: ThresholdResolution(thresholdValue,mask_id),  intervalLength(intervalLengthValue), intervalEndTime()
{}

/*
inline
IntervalThresholdResolution::IntervalThresholdResolution(uint16_t thresholdValue,
                                                         uint32_t intervalLengthValue,
                                                         uint32_t mask_id,
                                                         Resolution & r)
: ThresholdResolution(thresholdValue,mask_id,r), intervalLength(intervalLengthValue), intervalEndTime()
{}
*/
#endif // _OBSOLITE_
#endif /* prdfIntervalThresholdResolution_h */

// Change Log *********************************************************
//
//  Flag Reason   Vers    Date     Coder Description
//  ---- -------- ------  -------- ----- -------------------------------
//       ft637.1  csp     02/28/02  RAC  Initial Creation
//       368019   fsp     09/03/02 dgilbert port to FSP
//       390545   fsp     02/26/03 dgilbert inherrit from TresholdResolution
//
// End Change Log *****************************************************


/***************** END File prdfIntervalThresholdResolution.h
*********************************************************************/
/********************************************************************/
OpenPOWER on IntegriCloud