New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options for compressed content #2006
Comments
@milamberspace (migrated from Bugzilla): |
@milamberspace (migrated from Bugzilla): |
Sebb (migrated from Bugzilla):
Looks good to me. |
@milamberspace (migrated from Bugzilla): URL: http://svn.apache.org/viewvc?rev=1091965&view=rev Modified: |
@milamberspace (migrated from Bugzilla): |
@milamberspace (migrated from Bugzilla): Created attachment wiki-monip_jtl_and_pcap.zip: JTL + Wireshark capture |
Sebb (migrated from Bugzilla): I need to look further at httpcore to see why it could be reading ahead more in your case and not in mine. |
Sebb (migrated from Bugzilla): Metrics.java/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.http.examples.client;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.logging.LogManager;
import org.apache.http.HttpConnection;
import org.apache.http.HttpConnectionMetrics;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
public class Metrics {
private static void initLogging() throws Exception {
LogManager mgr = LogManager.getLogManager();
ByteArrayOutputStream os = new ByteArrayOutputStream();
PrintWriter pw = new PrintWriter(os);
pw.println("handlers=java.util.logging.ConsoleHandler");
pw.println("java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter");
pw.println("java.util.logging.ConsoleHandler.level = ALL");
pw.println("org.apache.http.level = FINEST");
pw.close();
InputStream ins = new ByteArrayInputStream(os.toByteArray());
mgr.readConfiguration(ins);
ins.close();
}
public static void main(String[] args) throws Exception {
initLogging();
DefaultHttpClient httpclient = new DefaultHttpClient();
try {
HttpRequestBase req = new HttpGet("http://wiki.apache.org/jakarta-jmeter/JMeterCommitters");
HttpContext localContext = new BasicHttpContext();
HttpResponse rsp = httpclient.execute(req, localContext);
System.err.println("*** "+rsp.getStatusLine());
HttpConnection conn = (HttpConnection) localContext.getAttribute(ExecutionContext.HTTP_CONNECTION);
HttpConnectionMetrics metrics = conn.getMetrics();
long hdr = metrics.getReceivedBytesCount();
System.err.println("*** HEADER "+hdr);
HttpEntity entity = rsp.getEntity();
if (entity != null) {
EntityUtils.consume(entity);
}
long total = metrics.getReceivedBytesCount();
System.err.println("*** TOTAL "+total);
} finally {
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown();
}
}
} |
Sebb (migrated from Bugzilla): |
Sebb (migrated from Bugzilla): Needs to be run with httpclient+httpcore. |
Sebb (migrated from Bugzilla): So let's use the header calculation method. I'll update the code. |
@pmouawad (migrated from Bugzilla): |
@milamberspace (migrated from Bugzilla): When I run Test Case https://issues.apache.org/bugzilla/attachment.cgi?id=26885, the only difference between HC3 and HC4 with chunked test is: The docs can be update with a notice to indicate this difference (in View Results Tree section). |
@pmouawad (migrated from Bugzilla): Date: Mon Feb 6 20:45:33 2012 URL: http://svn.apache.org/viewvc?rev=1241169&view=rev Modified: |
@pmouawad (migrated from Bugzilla): URL: http://svn.apache.org/viewvc?rev=1241292&view=rev Modified: |
Sebb (Bug 43363):
JMeter automatically decodes certain types of compressed content.
It might be useful to be able to switch off the decoding - so the compressed
response can be stored. Also it would be useful to have a way to record the
compressed size as well as the uncompressed size.
OS: other
The text was updated successfully, but these errors were encountered: