diff options
author | karl <karl> | 2013-12-18 12:23:33 +0000 |
---|---|---|
committer | karl <karl> | 2013-12-18 12:23:33 +0000 |
commit | 00dcf8ca97e61dd336ff23b31c818c76223991f1 (patch) | |
tree | 65f60097d3c7be41af29c9413019e247e013a3de | |
parent | e978d559bb368dd36225ff1d41135fd5b736a6f7 (diff) | |
download | tog-pegasus-TASK-PEP317_pullop-branch.zip tog-pegasus-TASK-PEP317_pullop-branch.tar.gz tog-pegasus-TASK-PEP317_pullop-branch.tar.xz |
BUG#: 9676TASK-PEP317_pullop-branch
TITLE: TASK-PEP317_pullop-branch Pull operations minor code changes
DESCRIPTION: Changed timer code, removed some couts, changed to use
cerr for error output from pullop
-rw-r--r-- | src/Pegasus/Client/tests/pullop/Makefile | 14 | ||||
-rw-r--r-- | src/Pegasus/Client/tests/pullop/pullop.cpp | 31 | ||||
-rw-r--r-- | src/Pegasus/ControlProviders/Statistic/CIMOMStatDataProvider.cpp | 6 | ||||
-rw-r--r-- | src/Pegasus/Server/CIMOperationRequestDispatcher.cpp | 12 | ||||
-rw-r--r-- | src/Pegasus/Server/EnumerationContext.cpp | 46 |
5 files changed, 56 insertions, 53 deletions
diff --git a/src/Pegasus/Client/tests/pullop/Makefile b/src/Pegasus/Client/tests/pullop/Makefile index 59930c4..1da656a 100644 --- a/src/Pegasus/Client/tests/pullop/Makefile +++ b/src/Pegasus/Client/tests/pullop/Makefile @@ -210,10 +210,10 @@ prn3: ## KS_TODO - This one causing failure in nightly tests. peManagedElement: - $(PROGRAM) e -M 100 -N 100 -c CIM_ManagedElement -v 5 $(HOSTID) + $(PROGRAM) e -M 100 -N 100 -c CIM_ManagedElement -v 5 -n root/cimv2 $(HOSTID) penManagedElement: - $(PROGRAM) en -M 50 -N 9 -C -c CIM_ManagedElement $(HOSTID) + $(PROGRAM) en -M 50 -N 9 -C -c CIM_ManagedElement -n root/cimv2 $(HOSTID) ### $(PROGRAM) en -M 9 -N 1 -C -c CIM_ManagedElement -n root/PG_InterOp $(HOSTID) ## KS_TODO this one generates an error @@ -468,7 +468,7 @@ cmpie1: ## reference tests -cmpir1: +clicmpir1: cimcli r $(CMPIASSOCOBJ) -n test/TestProvider $(CIMCLIHOSTID) pcmpir1: @@ -478,16 +478,14 @@ pcmpirn1: $(PROGRAM) rn -M 1 -N 1 -c $(CMPIASSOCOBJ) -n test/TestProvider -C -T $(HOSTID) ## Reference Operations Simple tests -cmpir1: - cimcli r $(CMPIASSOCOBJ) -n test/TestProvider $(CIMCLIHOSTID) -cmpirn1: +clicmpirn1: cimcli rn $(CMPIASSOCOBJ) -n test/TestProvider $(CIMCLIHOSTID) -cmpipr1: +clicmpipr1: cimcli r $(CMPIASSOCOBJ) -n test/TestProvider $(CIMCLIHOSTID) -cmpiprn1: +clicmpiprn1: cimcli rn $(CMPIASSOCOBJ) -n test/TestProvider $(CIMCLIHOSTID) diff --git a/src/Pegasus/Client/tests/pullop/pullop.cpp b/src/Pegasus/Client/tests/pullop/pullop.cpp index e32c616..90ca1f8 100644 --- a/src/Pegasus/Client/tests/pullop/pullop.cpp +++ b/src/Pegasus/Client/tests/pullop/pullop.cpp @@ -82,7 +82,7 @@ not as error prone. - Drop the existing defaults in favor of namespace = root/cimv2 and no target default. - - Expand object compare to more details (maybe) + - Expand object compare to more details (maybe) - Finish connect code so we can connect to other systems. Needs to be tested and determine if we need security. - Combine verbose and verbose_opt. i.e. Use a particular level @@ -842,7 +842,7 @@ bool compareInstance(const String& s1, const String& s2, if (i1.getPath() != i2.getPath()) { - cout << "WARN: Paths Not identical " << s1 << " " + cerr << "WARN: Paths Not identical " << s1 << " " << i1.getPath().toString() << " " << s2 << " " << i2.getPath().toString() << endl; @@ -851,19 +851,19 @@ bool compareInstance(const String& s1, const String& s2, else { - cout << "ERROR: Instances Not identical " + cerr << "ERROR: Instances Not identical " << i1.getPath().toString() << endl; if (i1.getQualifierCount() != i2.getQualifierCount()) { - cout << "ERROR: Qualifier Counts differ " + cerr << "ERROR: Qualifier Counts differ " << s1 << " " << i1.getQualifierCount() << " " << s2 << " " << i2.getQualifierCount() << endl; } bool switchInstances = false; if (i1.getPropertyCount() != i2.getPropertyCount()) { - cout << "ERROR: PropertyCounts differ " << s1 << " " + cerr << "ERROR: PropertyCounts differ " << s1 << " " << i1.getPropertyCount() << " " << s2 << " " << i2.getPropertyCount() << endl; @@ -915,7 +915,7 @@ bool compareInstance(const String& s1, const String& s2, { if (p1.getName() != p2.getName()) { - cout << "ERROR: Property Names differ. Property " << i + cerr << "ERROR: Property Names differ. Property " << i << " " << s11 << " " << p1.getName().getString() << " " << s21 << " " << p2.getName().getString() << endl; @@ -923,19 +923,19 @@ bool compareInstance(const String& s1, const String& s2, else if (p1.getType() != p2.getType()) { - cout << "ERROR: Property Types differ " + cerr << "ERROR: Property Types differ " << s11 << " " << p1.getName().getString() << " " << p1.getType() << " " << s21 << " " << p2.getType() << endl; } else if(p1.isArray() != p2.isArray()) { - cout << "Property Array flags differ " + cerr << "WARNING: Property Array flags differ " << p1.getName().getString() << endl; } else if(p1.getArraySize() != p2.getArraySize()) { - cout << "ERROR: Property Array size parameters differ " + cerr << "ERROR: Property Array size parameters differ " << p1.getName().getString() << " " << p1.getArraySize() << " " << p2.getArraySize() << endl; @@ -946,14 +946,14 @@ bool compareInstance(const String& s1, const String& s2, CIMValue v2 = p2.getValue(); if (!v1.equal(v2)) { - cout << "ERROR: Property values differ for " + cerr << "ERROR: Property values differ for " << p1.getName().getString() << " " << s11 << " " << v1.toString() << " " << s21 << " " << v2.toString() << endl; } else { - cout << "ERROR: Properties Not identical in param" + cerr << "ERROR: Properties Not identical in param" " other than type, value, etc " << i1.getPath().toString() << endl; } @@ -1411,7 +1411,7 @@ void testPullEnumerateInstances(CIMClient& client, CIMNamespaceName nameSpace, // if the compare opt was set, get with enumerate and compare if (compare_opt && endOfSequence) { - VCOUT << "Comparing Result to enumerateInstances" << endl; + VCOUT1 << "Comparing Result to enumerateInstances" << endl; enumTime.start(); Array<CIMInstance> enumeratedInstances = client.enumerateInstances( nameSpace, @@ -2255,7 +2255,7 @@ int main(int argc, char** argv) case 'v': // verbose display with integer { verbose_opt = stringToUint32(optarg); - if (verbose_opt > 6) + if (verbose_opt > 7) { cerr << "INPUT ERROR: max verbose level is 5" << endl; exit(1); @@ -2419,7 +2419,7 @@ int main(int argc, char** argv) { if (host_opt == "") { - VCOUT << "connectLocal" << endl; + VCOUT1 << "connectLocal" << endl; client.connectLocal(); } else @@ -2428,7 +2428,8 @@ int main(int argc, char** argv) Uint32 port; if (parseHostName(host_opt, hostName, port)) { - VCOUT << " Connect to host " << hostName << ":" << port << endl; + VCOUT1 << " Connect to host " + << hostName << ":" << port << endl; client.connect(hostName, port, user_opt, password_opt); } else diff --git a/src/Pegasus/ControlProviders/Statistic/CIMOMStatDataProvider.cpp b/src/Pegasus/ControlProviders/Statistic/CIMOMStatDataProvider.cpp index c2f7518..6bd2730 100644 --- a/src/Pegasus/ControlProviders/Statistic/CIMOMStatDataProvider.cpp +++ b/src/Pegasus/ControlProviders/Statistic/CIMOMStatDataProvider.cpp @@ -192,7 +192,8 @@ CIMInstance CIMOMStatDataProvider::buildInstance( CIMValue(Uint16(1)))); requestedInstance.addProperty(CIMProperty("OtherOperationType", CIMValue(sData->getRequestName(type)))); - cout << "Set other property " << sData->getRequestName(type) << endl; + // Test Diagnostic Output + // cout << "Set other property " << sData->getRequestName(type) << endl; } else { @@ -365,7 +366,8 @@ Uint16 CIMOMStatDataProvider::getValueMapType( outType=0; break; } - cout << "Proivder type mapper " << type << " returns" << outType << endl; + // test diagnostic output + //cout << "Proivder type mapper " << type << " returns" << outType << endl; return outType; } diff --git a/src/Pegasus/Server/CIMOperationRequestDispatcher.cpp b/src/Pegasus/Server/CIMOperationRequestDispatcher.cpp index 9661058..d9aaad4 100644 --- a/src/Pegasus/Server/CIMOperationRequestDispatcher.cpp +++ b/src/Pegasus/Server/CIMOperationRequestDispatcher.cpp @@ -287,18 +287,17 @@ void OperationAggregate::resequenceResponse(CIMResponseMessage& response) Boolean isComplete = response.isComplete(); // KS_PULLOP_TEMP TRACE PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, // EXP_PULL_TEMP - "%s resequenceinfo index %u" + "%s resequenceinfo index %u " "totalResponsesReceivedComplete = %u. _totalReceivedExpected = %u " - "provider isComplete %s" - " _totalIssued %u" + "provider isComplete %s " + "_totalIssued %u " "response.getIndex() %u", func,response.getIndex(), _totalReceivedComplete, _totalReceivedExpected, boolToString(isComplete), _totalIssued, - response.getIndex() - )); + response.getIndex() )); // if this provider is complete increment totalReceivedComplete, etc. if (isComplete == true) @@ -380,6 +379,9 @@ void OperationAggregate::resequenceResponse(CIMResponseMessage& response) } response.setComplete(isComplete); + + //// KS_TODO TBD this one is in error in that we have reset the + //// counters. Remove it. PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, // TODO KS_TEMP "%s: return status. isComplete: %s Total responses: %u, " "total chunks: %u, total errors: %u totalIssued: %u", diff --git a/src/Pegasus/Server/EnumerationContext.cpp b/src/Pegasus/Server/EnumerationContext.cpp index cea29d0..b5d7e93 100644 --- a/src/Pegasus/Server/EnumerationContext.cpp +++ b/src/Pegasus/Server/EnumerationContext.cpp @@ -375,17 +375,17 @@ Boolean EnumerationContext::putCache(CIMResponseMessage*& response, //// " signal CacheSizeConditon responseCacheMaximumSize %u", //// responseCacheSize(), to.size(), _responseCacheMaximumSize)); // start timer to get time of wait for statistics. - Stopwatch waitTimer; // KS_TEMP I think. should this be perm. - waitTimer.start(); + Uint64 startTime = TimeValue::getCurrentTime().toMicroseconds(); waitProviderLimitCondition(_responseCacheMaximumSize); - waitTimer.stop(); + Uint64 interval = + TimeValue::getCurrentTime().toMicroseconds() - startTime; PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, // EXP_PULL_TEMP "After putCache providers wait end ProviderLimitCondition Not " "complete insert responseCacheSize %u. CIMResponseData size %u." " signal CacheSizeConditon responseCacheMaximumSize %u." " Wait %lu usec", responseCacheSize(), to.size(), _responseCacheMaximumSize, - (unsigned long int)waitTimer.getElapsedUsec())); + (unsigned long int)interval )); } } @@ -469,7 +469,7 @@ void EnumerationContext::waitCacheSizeCondition(Uint32 size) } // start timer to get time of wait for statistics. -// Uint64 startTime = TimeValue::getCurrentTime().toMicroseconds(); + Uint64 startTime = TimeValue::getCurrentTime().toMicroseconds(); // condition variable wait loop. waits on cache size or // providers complete @@ -480,15 +480,15 @@ void EnumerationContext::waitCacheSizeCondition(Uint32 size) } _cacheTestCondMutex.unlock(); -// Uint64 interval = TimeValue::getCurrentTime().toMicroseconds() - startTime; -// -// PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, -// "waitCacheSizeConditon return " -// "Request Size %u complete %s result %s time %lu usec", -// size, -// boolToString(_providersComplete), -// boolToString((!_providersComplete && (responseCacheSize()) < size)), -// (unsigned long int)interval )); + Uint64 interval = TimeValue::getCurrentTime().toMicroseconds() - startTime; + + PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, + "waitCacheSizeConditon return " + "Request Size %u complete %s result %s time %lu usec", + size, + boolToString(_providersComplete), + boolToString((!_providersComplete && (responseCacheSize()) < size)), + (unsigned long int)interval )); PEG_METHOD_EXIT(); } @@ -528,21 +528,21 @@ void EnumerationContext::waitProviderLimitCondition(Uint32 limit) _providerLimitConditionMutex.lock(); -// Uint64 startTime = TimeValue::getCurrentTime().toMicroseconds(); + Uint64 startTime = TimeValue::getCurrentTime().toMicroseconds(); while (!_clientClosed && (responseCacheSize() > limit)) { _providerLimitCondition.wait(_providerLimitConditionMutex); } -// Uint64 interval = TimeValue::getCurrentTime().toMicroseconds() - startTime; -// -// PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, // EXP_PULL_TEMP -// "waitproviderLimitCondition exit state %s responseCacheSize %u size %u " -// "closed %s time %lu", -// boolToString((!_clientClosed && (responseCacheSize() < limit))), -// responseCacheSize(), limit, boolToString(_clientClosed), -// (long unsigned int)interval )); + Uint64 interval = TimeValue::getCurrentTime().toMicroseconds() - startTime; + + PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, // EXP_PULL_TEMP + "waitproviderLimitCondition exit state: %s responseCacheSize: %u " + "size: %u client closed: %s wait time: %lu us", + boolToString((!_clientClosed && (responseCacheSize() < limit))), + responseCacheSize(), limit, boolToString(_clientClosed), + (long unsigned int)interval )); _providerLimitConditionMutex.unlock(); PEG_METHOD_EXIT(); |