From f9c5f32a894cce9a3e8ac04fe3f47d3aa650cd85 Mon Sep 17 00:00:00 2001 From: Ren RenJuan Date: Thu, 30 Jan 2014 15:25:00 +0000 Subject: [PATCH] * --- AusRegCliever/include/AC_OTE.h | 26 +++++++++----------------- AusRegCliever/include/mdcommon.h | 1 + AusRegCliever/server/mdAusReg.cpp | 14 ++++++++++++-- AusRegCliever/server/mdJSON.cpp | 22 ++++++++++++---------- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/AusRegCliever/include/AC_OTE.h b/AusRegCliever/include/AC_OTE.h index 9158f58..55226af 100644 --- a/AusRegCliever/include/AC_OTE.h +++ b/AusRegCliever/include/AC_OTE.h @@ -22,8 +22,7 @@ namespace AC_OTE { testFuncs theseFuncs; bool acTkInitialised = false, fatal = false, done = false, transferGainer; - - const char *thisRegistry="Donuts", *thatAccount="secura2-ote2", *thisAccount="secura1-ote"; + const char *thisRegistry="Unknown", *thatAccount="Unknown", *thisAccount="Unknown"; char *thisName; int cmd=0,debug=1000; @@ -52,7 +51,7 @@ namespace AC_OTE { std::vector ns(1,std::string("ns1.google.com") );; const IntPostalInfo ctcPO(ctcName,ctcOrg, - ctcCrib,ctcCity,ctcProv,ctcPC,ctcGuo); + ctcCrib,ctcCity,ctcProv,ctcPC,ctcGuo); LPCrtCmdExtension crtE1( &claims ), crtE2( &dpml ); Transaction *thisTest; @@ -64,8 +63,7 @@ namespace AC_OTE { DomainCheckCommand *c = new DomainCheckCommand(thisName); DomainCheckResponse *r = new DomainCheckResponse(); - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push( new Transaction(c, r) ); } @@ -80,8 +78,7 @@ namespace AC_OTE { LPChkRespExtension chkRspE; r->registerExtension(&chkRspE); - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push(new Transaction(c, r)); } @@ -91,8 +88,7 @@ namespace AC_OTE { DomainCreateCommand *c = new DomainCreateCommand(thisName,pw,&RID, &tech, &ns, &admin, &billing); DomainCreateResponse *r = new DomainCreateResponse(); - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push(new Transaction(c, r)); } @@ -108,8 +104,7 @@ namespace AC_OTE { c->appendExtension(crtE1); DomainCreateResponse *r; - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push(new Transaction(c, r)); } void createContact() { @@ -118,8 +113,7 @@ namespace AC_OTE { ContactCreateCommand *c = new ContactCreateCommand(ctc,ctcPW,&ctcPO,ctcEmail); ContactCreateResponse *r = new ContactCreateResponse(); - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push(new Transaction(c, r)); } @@ -132,8 +126,7 @@ namespace AC_OTE { c->appendExtension(crtE2); DomainCreateResponse *r = new DomainCreateResponse(); - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push(new Transaction(c, r)); } @@ -145,8 +138,7 @@ namespace AC_OTE { c->appendExtension(crtE1); DomainCreateResponse *r = new DomainCreateResponse(); - thisTest = new Transaction(c, r); - acq.push(thisTest); + acq.push(new Transaction(c, r)); } diff --git a/AusRegCliever/include/mdcommon.h b/AusRegCliever/include/mdcommon.h index a524fbe..7b03d62 100644 --- a/AusRegCliever/include/mdcommon.h +++ b/AusRegCliever/include/mdcommon.h @@ -57,6 +57,7 @@ #ifndef SANS_BOOST #include +#include #endif using namespace std; diff --git a/AusRegCliever/server/mdAusReg.cpp b/AusRegCliever/server/mdAusReg.cpp index 109ad23..32aa14f 100644 --- a/AusRegCliever/server/mdAusReg.cpp +++ b/AusRegCliever/server/mdAusReg.cpp @@ -27,7 +27,7 @@ #include #include "mdJSON.hpp" -typedef std::priority_queue < Transaction* > ACWQ; +typedef boost::heap::priority_queue ACWQ; ACWQ acq; @@ -216,7 +216,7 @@ void ausRegEPPTK::registryXOTE() { // PROD in OTE } void ausRegEPPTK::doPROD() { - int hours=0,hoops,minutes=0,seconds=0,idleSeconds=0,lastSeconds=0,lastMinutes; + int debug=1000000,hours=0,hoops,minutes=0,seconds=0,idleSeconds=0,lastSeconds=0,lastMinutes; string op("newInstance"); scenario(thisConfig->tkScenario,thisConfig->cfg_path); @@ -238,7 +238,14 @@ void ausRegEPPTK::doPROD() if (!acq.empty()) { idleSeconds = 0; Transaction *tx = acq.top(); + + if (debug > 999) + theseLogs->logN(3,"Tx dequeued @ minute %d second %d (%d waiting).",minutes,seconds,acq.size()-1); + manager->execute(*tx); + if (debug > 999) + theseLogs->logN(2,"Tx completed @ minute %d second %d.",minutes,seconds); + acq.pop(); delete tx; @@ -260,6 +267,9 @@ void ausRegEPPTK::doPROD() theseLogs->logN(1,"AC Production Hour %d.",hours++); lastMinutes = minutes; } + + if (debug > 9999 && !(seconds % 10)) + theseLogs->logN(3,"AC Production %d:%d:%d.",hours-1,minutes,seconds); } sess->close(); diff --git a/AusRegCliever/server/mdJSON.cpp b/AusRegCliever/server/mdJSON.cpp index 6e9cd3c..3830922 100644 --- a/AusRegCliever/server/mdJSON.cpp +++ b/AusRegCliever/server/mdJSON.cpp @@ -65,23 +65,26 @@ bool mdJSON::run() for ( i = 0; i < itemNames.size(); ++i ) { const char *thisItem; try { thisItem = itemNames[i].c_str(); - if (debug > 100) + if (debug > 100000) theseLogs->logN(1,"item %s.",thisItem); + if (!stricmp(thisItem,"registry")) { + + } if (strncmp(thisItem,"case",4)) continue; if (strlen(thisItem) != 6) continue; - if (debug > 100) + if (debug > 100000) theseLogs->logN(1,"case %s.",thisItem); if (!AC_OTE::theseFuncs[thisItem]) { theseLogs->logN(1,"No logic to bind to '%s', need it.",thisItem); return false; } - if (!suite[i].isObject()) { - theseLogs->logN(1,"'%s' isn't an object, can't use.",thisItem); - continue; - } /* + //if (!suite[i].isObject()) { + // theseLogs->logN(1,"'%s' isn't an object, can't use.",thisItem); + // continue; + //} AC_OTE::theseCases[nCases].parms = NULL; AC_OTE::theseCases[nCases].fBody = AC_OTE::theseFuncs[thisItem]; - AC_OTE::theseCases[nCases++].caseName = thisItem; */ + AC_OTE::theseCases[nCases++].caseName = thisItem; } catch (...) { @@ -93,10 +96,9 @@ bool mdJSON::run() for (i=0;ilogN(2,"%d (%s) Begin ",i,AC_OTE::theseCases[i].caseName ); + theseLogs->logN(2,"%d Begin setup of %s ",i+1,AC_OTE::theseCases[i].caseName ); AC_OTE::theseCases[i].fBody(); - theseLogs->logN(2,"%d (%s) End ",i,AC_OTE::theseCases[i].caseName ); - + theseLogs->logN(2,"%d End setup of %s ",i+1,AC_OTE::theseCases[i].caseName ); } catch (...) {