-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add additional sync timing information #17643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
65e85d6
WIP - Add additional sync timing information
evantahler 2b237f5
Fixup tests
evantahler 974bec1
fix PMD problem
evantahler 9ce66aa
send data to segment
evantahler 4c2904a
Test JobTracker
evantahler 70c9dc2
respond to PR suggestions
evantahler 4f41818
fixup test
evantahler 6cd56c3
formatting
evantahler 5ba17a3
fix initializer for stats
evantahler 991b0a2
Make thread-safe with synchronized
evantahler 82125f4
Don't clobber syncStats on init
evantahler 3103f27
add comments and fix init
evantahler bd0d892
Do what Pedro says
evantahler 0eb2eb7
Extract timeTracker pojo
evantahler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
airbyte-commons-worker/src/main/java/io/airbyte/workers/helper/ThreadedTimeTracker.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.workers.helper; | ||
|
||
/** | ||
* This class exists to track timing information for the sync. It needs to be thread-safe as | ||
* multiple threads (source, destination, and worker) will be accessing it. | ||
*/ | ||
public class ThreadedTimeTracker { | ||
|
||
private long replicationStartTime; | ||
private long replicationEndTime; | ||
private long sourceReadStartTime; | ||
private long sourceReadEndTime; | ||
private long destinationWriteStartTime; | ||
private long destinationWriteEndTime; | ||
|
||
public synchronized void trackReplicationStartTime() { | ||
this.replicationStartTime = System.currentTimeMillis(); | ||
} | ||
|
||
public synchronized void trackReplicationEndTime() { | ||
this.replicationEndTime = System.currentTimeMillis(); | ||
} | ||
|
||
public synchronized void trackSourceReadStartTime() { | ||
this.sourceReadStartTime = System.currentTimeMillis(); | ||
} | ||
|
||
public synchronized void trackSourceReadEndTime() { | ||
this.sourceReadEndTime = System.currentTimeMillis(); | ||
} | ||
|
||
public synchronized void trackDestinationWriteStartTime() { | ||
this.destinationWriteStartTime = System.currentTimeMillis(); | ||
} | ||
|
||
public synchronized void trackDestinationWriteEndTime() { | ||
this.destinationWriteEndTime = System.currentTimeMillis(); | ||
} | ||
|
||
public synchronized long getReplicationStartTime() { | ||
return this.replicationStartTime; | ||
} | ||
|
||
public synchronized long getReplicationEndTime() { | ||
return this.replicationEndTime; | ||
} | ||
|
||
public synchronized long getSourceReadStartTime() { | ||
return this.sourceReadStartTime; | ||
} | ||
|
||
public synchronized long getSourceReadEndTime() { | ||
return this.sourceReadEndTime; | ||
} | ||
|
||
public synchronized long getDestinationWriteStartTime() { | ||
return this.destinationWriteStartTime; | ||
} | ||
|
||
public synchronized long getDestinationWriteEndTime() { | ||
return this.destinationWriteEndTime; | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.