Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

Update logs handling and statsd #21

Merged
merged 3 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ When you build the latest code from source, you'll have access to the latest sna
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
<scope>test</scope>
</dependency>
```
2 changes: 1 addition & 1 deletion browsermob-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public HttpResponse clientToProxyRequest(HttpObject httpObject) {

if (entry.matches(url, httpRequest.method().name())) {
HttpResponseStatus status = HttpResponseStatus.valueOf(entry.getStatusCode());
HttpResponse resp = new DefaultFullHttpResponse(httpRequest.getProtocolVersion(), status);
HttpResponse resp = new DefaultFullHttpResponse(httpRequest.protocolVersion(), status);
HttpUtil.setContentLength(resp, 0L);

return resp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import com.timgroup.statsd.NonBlockingStatsDClient;
import com.timgroup.statsd.StatsDClient;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.littleshoot.proxy.HttpFiltersAdapter;

import java.net.URI;
import java.net.URISyntaxException;
Expand All @@ -19,11 +19,10 @@ public StatsDMetricsFilter(HttpRequest originalRequest, ChannelHandlerContext ct
}

@Override
public HttpObject serverToProxyResponse(HttpObject httpObject) {
if (HttpResponse.class.isAssignableFrom(httpObject.getClass())) {
HttpResponse httpResponse = (HttpResponse) httpObject;
int status = httpResponse.status().code();
prepareStatsDMetrics(status);
public HttpObject proxyToClientResponse(HttpObject httpObject) {
if (FullHttpResponse.class.isAssignableFrom(httpObject.getClass())) {
HttpResponse httpResponse = (FullHttpResponse) httpObject;
prepareStatsDMetrics(httpResponse.status().code());
}
return super.serverToProxyResponse(httpObject);
}
Expand Down
2 changes: 1 addition & 1 deletion browsermob-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion browsermob-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion browsermob-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mitm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>2.1.29-SNAPSHOT</version>
<version>2.1.30-SNAPSHOT</version>
<modules>
<module>browsermob-core</module>
<module>browsermob-legacy</module>
Expand Down