os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/Te_EComPerfLoggerStep.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Implements the performance loggr for ECOM
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @internalComponent
    21 */
    22 
    23 #include "Te_EComPerfLoggerStep.h"
    24 #include <e32test.h>
    25 #include <f32file.h>
    26 #include <bautils.h>
    27 #include <startup.hrh>
    28 #include <ecom/ecom.h>
    29 #include "EComSessionAux.h"
    30 
    31 CEComPerfLogger::CEComPerfLogger() : CEComPerfTestBase(KEComPerfLogger)
    32 	{
    33 	}
    34 
    35 CEComPerfLogger::~CEComPerfLogger()
    36 /**
    37  * Destructor
    38  */
    39 	{
    40 	// does nothing here.
    41 	}
    42 	
    43 TVerdict CEComPerfLogger::doTestStepL()
    44 	{
    45 #ifdef __ECOM_SERVER_PERFORMANCE__
    46 	// get all the timer results from the server
    47 	RStartupStateTimerResults timerResults;
    48 	timerResults.GetAllTimerResults();
    49 
    50 	TInt i = 0;
    51 	TInt count = timerResults.Count();
    52 	for(i=0; i<count; i++)
    53 		{
    54 		const TStartupStateTimerResult& timerResult = timerResults.At(i);
    55 		
    56 		INFO_PRINTF3(_L("State: %d start time: %f mSecs\n"), timerResult.iState , timerResult.iStartTime);
    57 		INFO_PRINTF3(_L("State: %d end time: %f mSecs\n"), timerResult.iState, timerResult.iEndTime);
    58 		INFO_PRINTF3(_L("State: %d elapsed time: %f mSecs\n\n"), timerResult.iState, timerResult.iEndTime - timerResult.iStartTime);
    59 		}
    60 #else
    61 	MacroNotDefinedError();
    62 #endif // __ECOM_SERVER_PERFORMANCE__
    63 	return TestStepResult();
    64 	}