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