001/*
002 * ====================================================================
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *   http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied.  See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 * ====================================================================
020 *
021 * This software consists of voluntary contributions made by many
022 * individuals on behalf of the Apache Software Foundation.  For more
023 * information on the Apache Software Foundation, please see
024 * <http://www.apache.org/>.
025 *
026 */
027package org.apache.http.benchmark;
028
029/**
030 * Benchmark results
031 *
032 * @since 4.3
033 */
034public final class Results {
035
036    String serverName;
037    String hostName;
038    int hostPort;
039    String documentPath;
040    long contentLength;
041    int concurrencyLevel;
042    long totalTimeNano;
043    long successCount;
044    long failureCount;
045    long writeErrors;
046    long keepAliveCount;
047    long totalBytesRcvd;
048    long totalBytesSent;
049    long totalBytes;
050
051    Results() {
052        super();
053        this.contentLength = -1;
054    }
055
056    public String getServerName() {
057        return serverName;
058    }
059
060    public String getHostName() {
061        return hostName;
062    }
063
064    public int getHostPort() {
065        return hostPort;
066    }
067
068    public String getDocumentPath() {
069        return documentPath;
070    }
071
072    public long getContentLength() {
073        return contentLength;
074    }
075
076    public int getConcurrencyLevel() {
077        return concurrencyLevel;
078    }
079
080    public long getTotalTimeNano() {
081        return totalTimeNano;
082    }
083
084    public long getSuccessCount() {
085        return successCount;
086    }
087
088    public long getFailureCount() {
089        return failureCount;
090    }
091
092    public long getWriteErrors() {
093        return writeErrors;
094    }
095
096    public long getKeepAliveCount() {
097        return keepAliveCount;
098    }
099
100    public long getTotalBytesRcvd() {
101        return totalBytesRcvd;
102    }
103
104    public long getTotalBytesSent() {
105        return totalBytesSent;
106    }
107
108    public long getTotalBytes() {
109        return totalBytes;
110    }
111
112    @Override
113    public String toString() {
114        final StringBuilder builder = new StringBuilder();
115        builder.append("[serverName=").append(serverName)
116                .append(", hostName=").append(hostName)
117                .append(", hostPort=").append(hostPort)
118                .append(", documentPath=").append(documentPath)
119                .append(", contentLength=").append(contentLength)
120                .append(", concurrencyLevel=").append(concurrencyLevel)
121                .append(", totalTimeNano=").append(totalTimeNano)
122                .append(", successCount=").append(successCount)
123                .append(", failureCount=").append(failureCount)
124                .append(", writeErrors=").append(writeErrors)
125                .append(", keepAliveCount=").append(keepAliveCount)
126                .append(", totalBytesRcvd=").append(totalBytesRcvd)
127                .append(", totalBytesSent=").append(totalBytesSent)
128                .append(", totalBytes=").append(totalBytes)
129                .append("]");
130        return builder.toString();
131    }
132
133}