os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/Te_EComPerfLoggerStep.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/Te_EComPerfLoggerStep.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,64 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Implements the performance loggr for ECOM
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @internalComponent
    1.24 +*/
    1.25 +
    1.26 +#include "Te_EComPerfLoggerStep.h"
    1.27 +#include <e32test.h>
    1.28 +#include <f32file.h>
    1.29 +#include <bautils.h>
    1.30 +#include <startup.hrh>
    1.31 +#include <ecom/ecom.h>
    1.32 +#include "EComSessionAux.h"
    1.33 +
    1.34 +CEComPerfLogger::CEComPerfLogger() : CEComPerfTestBase(KEComPerfLogger)
    1.35 +	{
    1.36 +	}
    1.37 +
    1.38 +CEComPerfLogger::~CEComPerfLogger()
    1.39 +/**
    1.40 + * Destructor
    1.41 + */
    1.42 +	{
    1.43 +	// does nothing here.
    1.44 +	}
    1.45 +	
    1.46 +TVerdict CEComPerfLogger::doTestStepL()
    1.47 +	{
    1.48 +#ifdef __ECOM_SERVER_PERFORMANCE__
    1.49 +	// get all the timer results from the server
    1.50 +	RStartupStateTimerResults timerResults;
    1.51 +	timerResults.GetAllTimerResults();
    1.52 +
    1.53 +	TInt i = 0;
    1.54 +	TInt count = timerResults.Count();
    1.55 +	for(i=0; i<count; i++)
    1.56 +		{
    1.57 +		const TStartupStateTimerResult& timerResult = timerResults.At(i);
    1.58 +		
    1.59 +		INFO_PRINTF3(_L("State: %d start time: %f mSecs\n"), timerResult.iState , timerResult.iStartTime);
    1.60 +		INFO_PRINTF3(_L("State: %d end time: %f mSecs\n"), timerResult.iState, timerResult.iEndTime);
    1.61 +		INFO_PRINTF3(_L("State: %d elapsed time: %f mSecs\n\n"), timerResult.iState, timerResult.iEndTime - timerResult.iStartTime);
    1.62 +		}
    1.63 +#else
    1.64 +	MacroNotDefinedError();
    1.65 +#endif // __ECOM_SERVER_PERFORMANCE__
    1.66 +	return TestStepResult();
    1.67 +	}