29 #ifndef ONLY_LOCAL_PROXY
67 for (tmp = 0; tmp < 256; tmp++)
69 for (tmp2 = 0; tmp2 < 256; tmp2++)
131 (((
UINT64) key[3]) << 48) +
132 (((
UINT64) key[4]) << 40) +
133 (((
UINT64) key[5]) << 32) +
134 (((
UINT64) key[6]) << 24) +
135 (((
UINT64) key[7]) << 16) +
136 (((
UINT64) key[8]) << 8) +
146 if (tmp->
key != hashkey)
170 if (tmp->
key != hashkey)
195 if (tmp->
key != hashkey)
312 UINT32 aktNrOfEntries = lowerBoundEntries;
313 UINT8* key =
new UINT8[insertsPerMeasure * 16];
317 const char* atemplate =
"%u,%u,%u\n";
319 "The format is as follows: Number of Entries in DB, Number of Inserts done, Total time for Inserts (in micro seconds)\n";
320 write(file, header, strlen(header));
321 while (aktNrOfEntries <= upperBoundEntries)
323 CAMsg::printMsg(LOG_DEBUG,
"Starting measurement with %u entries in the replay database\n", aktNrOfEntries);
324 for (
UINT32 i = 0; i < meassuresPerStep; i++)
327 pDatabase->
fill(aktNrOfEntries);
328 UINT64 startTime, endTime;
332 for (
UINT32 j = 0; j < insertsPerMeasure; j++)
338 sprintf(buff, atemplate, aktNrOfEntries, insertsPerMeasure,
diff64(endTime, startTime));
339 write(file, buff, strlen(buff));
340 printf(
"Start delete \n");
345 printf(
"delete takes %u microsecs\n",
diff64(endTime, startTime));
347 aktNrOfEntries += stepBy;
358 while (i < nrOfEntries)
371 UINT16 timestamp = (key[14] << 8) | key[15];
372 if (timestamp < m_currentClock - 1 || timestamp >
m_currentClock + 1)
THREAD_RETURN db_loopMaintenance(void *param)
struct _t_database_info t_databaseInfo
#define SECONDS_PER_INTERVALL
struct _t_database_entry t_databaseEntry
#define BEGIN_STACK(methodName)
#define FINISH_STACK(methodName)
SINT32 getcurrentTimeMicros(UINT64 &u64Time)
Gets the current Systemtime in micros seconds.
SINT32 sSleep(UINT32 sec)
Sleeps sec Seconds.
SINT32 getRandom(UINT32 *val)
Gets 32 random bits.
UINT32 diff64(const UINT64 &bigop, const UINT64 &smallop)
#define THREAD_RETURN_SUCCESS
struct __UINT64__t_ UINT64
SINT32 deleteDB(t_databaseInfo *&pDB)
Deletes the whole database pDB.
t_databaseInfo * m_prevDatabase
t_databaseInfo * createDBInfo()
Creates and initialises a dbinfo struct.
friend THREAD_RETURN db_loopMaintenance(void *param)
t_databaseInfo * m_currDatabase
SINT32 clearDB(t_databaseInfo *pDB)
clears the whole database pDB - but does not delete the hashtable pDB
static SINT32 measurePerformance(UINT8 *strLogFile, UINT32 lowerBoundEntries, UINT32 upperBoundEntries, UINT32 stepBy, UINT32 meassuresPerStep, UINT32 insertsPerMeasure)
This mehtod can be used to measure the performance of the Replay database.
SINT32 simulateInsert(UINT8 key[16])
This is a modified copy of insert() which simulates the insert() function as close as possible withou...
t_databaseInfo * m_nextDatabase
SINT32 insert(UINT8 key[16], UINT64 timestamp)
Inserts this key in the replay DB.
volatile SINT32 m_currentClock
SINT32 fill(UINT32 nrOfEntries)
Pre fills the database with nrOfEntries random entries.
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
SINT32 start(void *param, bool bDaemon=false, bool bSilent=false)
Starts the execution of the main function of this thread.
SINT32 setMainLoop(THREAD_MAIN_TYP fnc)
Sets the main function which will be executed within this thread.
SINT32 join()
Waits for the main function to finish execution.
t_databaseEntry * m_pHashTable[0x100][0x100]