1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PERFORMANCE_TEST_H
17 #define PERFORMANCE_TEST_H
18 
19 #include "base_test.h"
20 
21 namespace Contacts {
22 namespace Test {
23 class PerformanceTest : public BaseTest {
24 public:
25     static constexpr int TIME_USEC_CALL_LOG_INSERT = 100000000;
26     static constexpr int TIME_USEC_CALL_LOG_UPDATE = 3000000;
27     static constexpr int TIME_USEC_CALL_LOG_QUERY = 5000000;
28     static constexpr int TIME_USEC_CALL_LOG_DELETED = 700000;
29 
30     static constexpr int TIME_USEC_VOICEMAIL_INSERT = 100000000;
31     static constexpr int TIME_USEC_VOICEMAIL_UPDATE = 300000;
32     static constexpr int TIME_USEC_VOICEMAIL_QUERY = 5000000;
33     static constexpr int TIME_USEC_VOICEMAIL_DELETED = 700000;
34 
35     static constexpr int TIME_USEC_RAW_CONTACT_INSERT = 110000000;
36     static constexpr int TIME_USEC_RAW_CONTACT_UPDATE = 3000000;
37     static constexpr int TIME_USEC_RAW_CONTACT_QUERY = 5000000;
38     static constexpr int TIME_USEC_RAW_CONTACT_DELETED = 8000000;
39 
40     static constexpr int TIME_USEC_CONTACT_DATA_INSERT = 75000000;
41     static constexpr int TIME_USEC_CONTACT_DATA_UPDATE = 40000000;
42     static constexpr int TIME_USEC_CONTACT_DATA_QUERY = 7000000;
43     static constexpr int TIME_USEC_CONTACT_DATA_DELETED = 40000000;
44 
45     PerformanceTest();
46     ~PerformanceTest();
47     int64_t GetCurrentTime();
48     int CalcTime(int64_t startTime, int64_t endTime);
49     void DeleteContact();
50 };
51 } // namespace Test
52 } // namespace Contacts
53 #endif // PERFORMANCE_TEST_H
54