version 1.22.8.5, 2013/10/13 21:31:59
|
version 1.22.8.6, 2013/10/14 16:25:59
|
|
|
// Pegasus CIM_StatisticalData | // Pegasus CIM_StatisticalData |
// message type | // message type |
// -------------- ------------------- | // -------------- ------------------- |
"Unknown", // 0 default |
//"Unknown", // 0 default |
"Other", // 1 mapped |
//"Other", // 1 mapped |
"Batched", // 2 not used |
//"Batched", // 2 not used |
"GetClass", // 1 3 | "GetClass", // 1 3 |
"GetInstance", // 2 4 | "GetInstance", // 2 4 |
"IndicationDelivery", // 3 26 | "IndicationDelivery", // 3 26 |
|
|
"PullInstancePaths", // 77 | "PullInstancePaths", // 77 |
"CloseEnumeration" , // 79 | "CloseEnumeration" , // 79 |
//EXP_PULL_END | //EXP_PULL_END |
|
|
}; | }; |
| |
const Uint32 StatisticalData::length = NUMBER_OF_TYPES; | const Uint32 StatisticalData::length = NUMBER_OF_TYPES; |
| |
StatisticalData* StatisticalData::cur = NULL; |
// Pointer to StatisticalData table if it exists. |
|
StatisticalData* StatisticalData::table = NULL; |
| |
// If first call, create the statistical data array | // If first call, create the statistical data array |
StatisticalData* StatisticalData::current() | StatisticalData* StatisticalData::current() |
{ | { |
if (cur == NULL) |
if (table == NULL) |
{ | { |
cur = new StatisticalData(); |
table = new StatisticalData(); |
} | } |
return cur; |
return table; |
} | } |
| |
// Clear the statisticalData Array |
// Constructor clears the statisticalData Array and sets the gatherint |
|
// flag to zero |
StatisticalData::StatisticalData() | StatisticalData::StatisticalData() |
{ | { |
copyGSD = 0; | copyGSD = 0; |
|
clear(); |
|
} |
| |
|
void StatisticalData::clear() |
|
{ |
|
AutoMutex autoMut(_mutex); |
for (unsigned int i=0; i<StatisticalData::length; i++) | for (unsigned int i=0; i<StatisticalData::length; i++) |
{ | { |
numCalls[i] = 0; | numCalls[i] = 0; |
|
|
} | } |
} | } |
| |
|
String StatisticalData::getRequestName(Uint16 i) |
|
{ |
|
return requestName[i]; |
|
} |
|
|
void StatisticalData::addToValue(Sint64 value, | void StatisticalData::addToValue(Sint64 value, |
MessageType msgType, | MessageType msgType, |
StatDataType t) | StatDataType t) |
{ | { |
// Map MessageType to statistic type |
// Map MessageType to statistic type. Requires multiple tests because |
|
// mapping request and responses to the request types. |
Uint16 type; | Uint16 type; |
if ((msgType) >= CIM_OPEN_ENUMERATE_INSTANCES_RESPONSE_MESSAGE) | if ((msgType) >= CIM_OPEN_ENUMERATE_INSTANCES_RESPONSE_MESSAGE) |
{ | { |
|
|
} | } |
else | else |
{ | { |
type = msgType; |
type = msgType - 1; |
} | } |
| |
//// KS_TODO diagnostic to confirm that the above if statements are correct | //// KS_TODO diagnostic to confirm that the above if statements are correct |