com.newrelic.opentracing.pipe.NrTelemetryPipe Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-java-lambda Show documentation
Show all versions of newrelic-java-lambda Show documentation
New Relic OpenTracing Tracer implementation for instrumenting AWS Lambda functions.
The newest version!
package com.newrelic.opentracing.pipe;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class NrTelemetryPipe {
private final File namedPipePath;
public NrTelemetryPipe(File namedPipePath) {
this.namedPipePath = namedPipePath;
}
public boolean namedPipeExists() {
return namedPipePath.exists();
}
public void writeToPipe(String payload) throws IOException {
try (BufferedWriter pipe = new BufferedWriter(new FileWriter(namedPipePath, false))) {
pipe.write(payload);
}
}
}