ai.vespa.metricsproxy.http.MetricsJsonResponse Maven / Gradle / Ivy
package ai.vespa.metricsproxy.http;
import com.yahoo.container.jdisc.HttpResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.function.Consumer;
/**
* @author jonmv
*/
public class MetricsJsonResponse extends HttpResponse {
private final Consumer modelWriter;
public MetricsJsonResponse(int status, Consumer modelWriter) {
super(status);
this.modelWriter = modelWriter;
}
@Override
public void render(OutputStream outputStream) throws IOException {
modelWriter.accept(outputStream);
}
@Override
public long maxPendingBytes() {
return 1 << 20;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy