-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Integrate source performance harness with datadog #31410
Merged
Merged
Changes from 30 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
7e185e1
empty line to create a PR
xiaohansong 9023148
Automated Commit - Formatting Changes
xiaohansong f167679
attempt a fix
xiaohansong dfc9c67
typo
xiaohansong 8542cac
add logs
xiaohansong 21cabaa
try adding path directly
xiaohansong 86b6ca9
whoami?
xiaohansong 406da8b
export path in write part
xiaohansong 9dd5c7c
add secrets
xiaohansong 3d98ddd
try different way to create cred
xiaohansong 0fb5fef
Merge remote-tracking branch 'origin/master' into xiaohan/harness-fix
xiaohansong ba4f4f3
remove unnecessary printout
xiaohansong 6a97539
make comment optional
xiaohansong 4d42500
Merge branch 'master' into xiaohan/harness-fix
xiaohansong 0adb090
update postgres catalog
xiaohansong c4a2bd3
Automated Commit - Formatting Changes
xiaohansong 1ed2779
Merge branch 'master' into xiaohan/harness-fix
xiaohansong 86f5f05
add more logs, suspecting it's not reading from the latest catalog
xiaohansong bd758f3
more logs
xiaohansong 637a9df
remove gitref
xiaohansong 2ab9f44
need to check local branch and master branch to do git diff
xiaohansong 59eb0be
remove origin
xiaohansong a08ad54
need to fetch all in perf-test step
xiaohansong daa81f2
add back ref
xiaohansong 4d07a76
remove logs
xiaohansong ceade6d
Merge branch 'master' into xiaohan/harness-fix
xiaohansong beee3ee
formatting
xiaohansong 5d7fc32
datadog test
xiaohansong e0a6dc2
insert real datadog metrics
xiaohansong f06d2e0
Merge remote-tracking branch 'origin/master' into xiaohan/datadog-perf
xiaohansong 2176e08
Automated Commit - Formatting Changes
xiaohansong 04a1d97
format and env
xiaohansong 1d52f3f
Merge branch 'master' into xiaohan/datadog-perf
xiaohansong e0d46d6
test without export envsubst would still work or not
xiaohansong 5888e9a
export changed names only:
xiaohansong dcc7d8f
revert
xiaohansong c0a2686
one more try
xiaohansong f04d291
updated comment
xiaohansong 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 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 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 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 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 |
---|---|---|
|
@@ -4,6 +4,15 @@ | |
|
||
package io.airbyte.integrations.source_performance; | ||
|
||
import com.datadog.api.client.ApiClient; | ||
import com.datadog.api.client.ApiException; | ||
import com.datadog.api.client.v2.api.MetricsApi; | ||
import com.datadog.api.client.v2.model.MetricIntakeType; | ||
import com.datadog.api.client.v2.model.MetricPayload; | ||
import com.datadog.api.client.v2.model.MetricPoint; | ||
import com.datadog.api.client.v2.model.MetricResource; | ||
import com.datadog.api.client.v2.model.MetricSeries; | ||
import com.datadog.api.client.v2.model.IntakePayloadAccepted; | ||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
@@ -26,6 +35,9 @@ | |
import java.net.InetAddress; | ||
import java.nio.file.Path; | ||
import java.time.Duration; | ||
import java.time.Instant; | ||
import java.time.OffsetDateTime; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
@@ -43,17 +55,24 @@ public class PerformanceTest { | |
|
||
public static final double MEGABYTE = Math.pow(1024, 2); | ||
private final String imageName; | ||
private final String dataset; | ||
private final JsonNode config; | ||
private final ConfiguredAirbyteCatalog catalog; | ||
|
||
PerformanceTest(final String imageName, final String config, final String catalog) throws JsonProcessingException { | ||
PerformanceTest(final String imageName, final String dataset, final String config, final String catalog) throws JsonProcessingException { | ||
final ObjectMapper mapper = new ObjectMapper(); | ||
this.imageName = imageName; | ||
this.dataset = dataset; | ||
this.config = mapper.readTree(config); | ||
this.catalog = Jsons.deserialize(catalog, ConfiguredAirbyteCatalog.class); | ||
} | ||
|
||
void runTest() throws Exception { | ||
|
||
// Initialize datadog. | ||
ApiClient defaultClient = ApiClient.getDefaultApiClient(); | ||
MetricsApi apiInstance = new MetricsApi(defaultClient); | ||
|
||
KubePortManagerSingleton.init(PORTS); | ||
|
||
final KubernetesClient fabricClient = new DefaultKubernetesClient(); | ||
|
@@ -105,8 +124,45 @@ void runTest() throws Exception { | |
final var totalMB = totalBytes / MEGABYTE; | ||
final var totalTimeSecs = (end - start) / 1000.0; | ||
final var rps = counter / totalTimeSecs; | ||
log.info("total secs: {}. total MB read: {}, rps: {}, throughput: {}", totalTimeSecs, totalMB, rps, totalMB / totalTimeSecs); | ||
final var throughput = totalMB / totalTimeSecs; | ||
log.info("total secs: {}. total MB read: {}, rps: {}, throughput: {}", totalTimeSecs, totalMB, rps, throughput); | ||
source.close(); | ||
|
||
final long reportingTimeInEpochSeconds = OffsetDateTime.now().toInstant().getEpochSecond(); | ||
|
||
List<MetricResource> metricResources = List.of( | ||
new MetricResource().name("github").type("runner"), | ||
new MetricResource().name(imageName).type("image"), | ||
new MetricResource().name(dataset).type("dataset")); | ||
MetricPayload body = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. amazing! |
||
new MetricPayload() | ||
.series( | ||
List.of( | ||
new MetricSeries() | ||
.metric("connectors.performance.rps") | ||
.type(MetricIntakeType.GAUGE) | ||
.points( | ||
Collections.singletonList( | ||
new MetricPoint() | ||
.timestamp(reportingTimeInEpochSeconds) | ||
.value(rps))) | ||
.resources(metricResources), | ||
new MetricSeries() | ||
.metric("connectors.performance.throughput") | ||
.type(MetricIntakeType.GAUGE) | ||
.points( | ||
Collections.singletonList( | ||
new MetricPoint() | ||
.timestamp(reportingTimeInEpochSeconds) | ||
.value(throughput))) | ||
.resources(metricResources) | ||
)); | ||
try { | ||
IntakePayloadAccepted result = apiInstance.submitMetrics(body); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
log.error("Exception when calling MetricsApi#submitMetrics.", e); | ||
} | ||
} | ||
|
||
private static <V0, V1> V0 convertProtocolObject(final V1 v1, final Class<V0> klass) { | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set this env var in the
env:
section of this step