| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 namespace base { | 11 namespace base { |
| 14 class TimeDelta; | 12 class TimeDelta; |
| 15 } | 13 } |
| 16 | 14 |
| 17 class ProfileSyncServiceHarness; | 15 class ProfileSyncServiceHarness; |
| 18 | 16 |
| 19 class SyncTimingHelper { | 17 namespace sync_timing_helper { |
| 20 public: | |
| 21 SyncTimingHelper(); | |
| 22 ~SyncTimingHelper(); | |
| 23 | 18 |
| 24 // Returns the time taken for |client| to complete a single sync cycle. | 19 // Returns the time taken for |client| to complete a single sync cycle. |
| 25 static base::TimeDelta TimeSyncCycle(ProfileSyncServiceHarness* client); | 20 base::TimeDelta TimeSyncCycle(ProfileSyncServiceHarness* client); |
| 26 | 21 |
| 27 // Returns the time taken for both |client| and |partner| to complete a sync | 22 // Returns the time taken for both |client| and |partner| to complete a sync |
| 28 // cycle. | 23 // cycle. |
| 29 static base::TimeDelta TimeMutualSyncCycle( | 24 base::TimeDelta TimeMutualSyncCycle(ProfileSyncServiceHarness* client, |
| 30 ProfileSyncServiceHarness* client, ProfileSyncServiceHarness* partner); | 25 ProfileSyncServiceHarness* partner); |
| 31 | 26 |
| 32 // Returns the time taken for all clients in |clients| to complete their | 27 // Returns the time taken for all clients in |clients| to complete their |
| 33 // respective sync cycles. | 28 // respective sync cycles. |
| 34 static base::TimeDelta TimeUntilQuiescence( | 29 base::TimeDelta TimeUntilQuiescence( |
| 35 std::vector<ProfileSyncServiceHarness*>& clients); | 30 const std::vector<ProfileSyncServiceHarness*>& clients); |
| 36 | 31 |
| 37 // Print a timing measurement in a format appropriate for the chromium perf | 32 // Print a timing measurement in a format appropriate for the chromium perf |
| 38 // dashboard. Simplified version of methods defined in | 33 // dashboard. Simplified version of methods defined in |
| 39 // chrome/test/ui/ui_perf_test.{h,cc}. | 34 // chrome/test/ui/ui_perf_test.{h,cc}. |
| 40 static void PrintResult(const std::string& measurement, | 35 void PrintResult(const std::string& measurement, |
| 41 const std::string& trace, | 36 const std::string& trace, |
| 42 const base::TimeDelta& dt); | 37 const base::TimeDelta& dt); |
| 43 | 38 |
| 44 private: | 39 } // namespace sync_timing_helper |
| 45 DISALLOW_COPY_AND_ASSIGN(SyncTimingHelper); | |
| 46 }; | |
| 47 | 40 |
| 48 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H
_ | 41 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H
_ |
| OLD | NEW |