Example usage for io.vertx.core.http HttpServerResponse bytesWritten

List of usage examples for io.vertx.core.http HttpServerResponse bytesWritten

Introduction

In this page you can find the example usage for io.vertx.core.http HttpServerResponse bytesWritten.

Prototype

long bytesWritten();

Source Link

Usage

From source file:org.apache.servicecomb.transport.rest.vertx.accesslog.element.impl.ResponseSizeItem.java

License:Apache License

@Override
public String getFormattedItem(AccessLogParam<RoutingContext> accessLogParam) {
    HttpServerResponse response = accessLogParam.getContextData().response();
    if (null == response) {
        return zeroBytes;
    }//from  ww w .  j  a va2s .  co m

    long bytesWritten = response.bytesWritten();
    return 0 == bytesWritten ? zeroBytes : String.valueOf(bytesWritten);
}