1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
25 #include <e32base.h> |
25 #include <e32base.h> |
26 #include <test/tefexportconst.h> |
26 #include <test/tefexportconst.h> |
27 |
27 |
28 class CTestStep; |
28 class CTestStep; |
29 |
29 |
30 _LIT(KSqlInsert, "SQL_UPLOAD_VERSION_0:insert into performance.testresultstable (sessionid, testname, testattribute, testunits, testresultvalue) values "); |
|
31 _LIT(KSqlData, "SQL_UPLOAD_VERSION_0:('%u', '%S', '%S', '%S', '%d');"); |
|
32 _LIT(KMicroSeconds, "us"); |
|
33 _LIT(KPixelsPerSecond, "pixels/second"); |
|
34 _LIT(KFrameRate, "frames/second"); |
|
35 _LIT(KCharacterRate, "characters/second"); |
|
36 _LIT(KGlyphRate, "glyphs/second"); |
|
37 _LIT(KVariation, "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i"); |
|
38 _LIT(KVariationPPI, "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i_PPI_%i"); |
|
39 _LIT(KVariationZOrder, "ZOrd_%i_SrcMode_%i_DestMode_%i_Iters_%i_PPI_%i"); |
|
40 _LIT(KVariationCPI, "Rot_%i_SrcMode_%i_DestMode_%i_Iters_%i_CPI_%i"); |
|
41 _LIT(KMaxTime, "%S_Max"); |
|
42 _LIT(KMinTime, "%S_Min"); |
|
43 _LIT(KMean, "%S_Mean"); |
|
44 _LIT(KTrimmedMean, "%S_TrimmedMean"); |
|
45 |
30 |
46 class CTProfiler : public CBase |
31 class CTProfiler : public CBase |
47 { |
32 { |
48 public: |
33 public: |
49 IMPORT_C static CTProfiler* NewL(CTestStep& aTestStep); |
34 IMPORT_C static CTProfiler* NewL(CTestStep& aTestStep); |
50 IMPORT_C ~CTProfiler(); |
35 IMPORT_C ~CTProfiler(); |
51 IMPORT_C void StartTimer(); |
36 IMPORT_C void StartTimer(); |
52 IMPORT_C TInt64 StopTimer(); |
37 IMPORT_C TInt64 StopTimer(); |
53 IMPORT_C void InitResults(); |
38 IMPORT_C void InitResults(); |
54 IMPORT_C void MarkResultSetL(); |
39 IMPORT_C void MarkResultSetL(); |
55 IMPORT_C void MarkResultSetAndSuspendL(); |
|
56 IMPORT_C TUint32 GetTrimedMean(); |
40 IMPORT_C TUint32 GetTrimedMean(); |
57 IMPORT_C TUint32 Mean(); |
41 IMPORT_C TUint32 Mean(); |
58 IMPORT_C TInt PercentageChange(TInt aFirstTime, TInt aSecondTime); |
42 IMPORT_C TInt PercentageChange(TInt aFirstTime, TInt aSecondTime); |
59 IMPORT_C void ResultsAnalysis(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters); |
43 IMPORT_C void ResultsAnalysis(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters); |
60 IMPORT_C void ResultsAnalysisPixelRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
44 IMPORT_C void ResultsAnalysisPixelRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
63 IMPORT_C void ResultsAnalysisAverageByNumberOfIterations(const TDesC& aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters); |
47 IMPORT_C void ResultsAnalysisAverageByNumberOfIterations(const TDesC& aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters); |
64 IMPORT_C void ResultsAnalysisFrameRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
48 IMPORT_C void ResultsAnalysisFrameRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
65 IMPORT_C void ResultsAnalysisScreenRotationRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
49 IMPORT_C void ResultsAnalysisScreenRotationRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
66 IMPORT_C void ResultsAnalysisZorderSwitchingRate(const TDesC & aTestName, TInt aZorderSwitching, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
50 IMPORT_C void ResultsAnalysisZorderSwitchingRate(const TDesC & aTestName, TInt aZorderSwitching, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
67 IMPORT_C void FreeResultsMemory(); |
51 IMPORT_C void FreeResultsMemory(); |
68 IMPORT_C TUint32 TimeMax(); |
|
69 IMPORT_C TUint32 TimeMin(); |
|
70 IMPORT_C void ShowResultArrayInTimingOrder(); |
|
71 IMPORT_C void SetStoreResultInTimingOrder(TBool aStoreResultInTimingOrder); |
|
72 IMPORT_C void SqlInsert(const TDesC* aTestName, const TDesC* aTestAttribute, const TDesC* aTestUnit, TInt32 aTestResultValue); |
|
73 IMPORT_C void ResultsAnalysisGlyphRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels); |
|
74 |
52 |
75 private: |
53 private: |
76 CTProfiler(CTestStep& aTestStep); |
54 CTProfiler(CTestStep& aTestStep); |
77 void ConstructL(); |
55 void ConstructL(); |
78 |
56 TUint32 TimeMax(); |
|
57 TUint32 TimeMin(); |
79 private: |
58 private: |
80 TUint32 iStart; |
59 TUint32 iStart; |
81 TUint32 iEnd; |
60 TUint32 iEnd; |
82 TUint32 iDiff; |
61 TUint32 iDiff; |
83 TInt iFreq; |
62 TInt iFreq; |
84 RArray<TUint32> iResults; |
63 RArray<TUint32> iResults; |
85 RArray<TUint32> iResultsTimingOrder; |
|
86 TBool iResultsInitalised; |
64 TBool iResultsInitalised; |
87 CTestStep& iTestStep; |
65 CTestStep& iTestStep; |
88 TBool iStoreResultInTimingOrder; |
|
89 /* |
|
90 * The session identifier is a number which allows a number of |
|
91 * related performance metrics for a given test to be grouped |
|
92 * under the same "session". |
|
93 */ |
|
94 TUint32 iSessionId; |
|
95 }; |
66 }; |
96 |
67 |
97 #endif |
68 #endif |
98 |
69 |
99 |
70 |