All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.vespa.metricsproxy.http.MetricsJsonResponse Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
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