-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into datadog/trace-agent-sampling-feedback-opti…
…mization
- Loading branch information
Showing
6 changed files
with
45 additions
and
36 deletions.
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
10 changes: 0 additions & 10 deletions
10
dd-java-agent/instrumentation/aws-lambda-handler/src/test/groovy/Handler.java
This file was deleted.
Oops, something went wrong.
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
26 changes: 26 additions & 0 deletions
26
dd-trace-core/src/main/java/datadog/trace/lambda/ReadFromOutputStreamJsonAdapter.java
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package datadog.trace.lambda; | ||
|
||
import com.squareup.moshi.JsonAdapter; | ||
import com.squareup.moshi.JsonReader; | ||
import com.squareup.moshi.JsonWriter; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import okio.BufferedSink; | ||
|
||
public final class ReadFromOutputStreamJsonAdapter extends JsonAdapter<ByteArrayOutputStream> { | ||
|
||
@Override | ||
public ByteArrayOutputStream fromJson(JsonReader reader) throws IOException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void toJson(JsonWriter writer, ByteArrayOutputStream outputStream) throws IOException { | ||
if (outputStream != null) { | ||
BufferedSink sink = writer.valueSink(); | ||
byte[] bytes = outputStream.toByteArray(); | ||
sink.write(bytes); | ||
sink.flush(); | ||
} | ||
} | ||
} |
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