Skip to content

Commit 397e0aa

Browse files
author
Kapil Rastogi
authored
Merge pull request #67 from ExpediaDotCom/pitchfork-gzip
enable gzip config by default for pitchfork
2 parents ae1405c + 8b9cb0e commit 397e0aa

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

agent-providers/span/src/main/java/com/expedia/www/haystack/agent/pitchfork/service/config/HttpConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static HttpConfig from(Config config) {
9090
final int idleTimeout = config.hasPath(IDLE_TIMEOUT_MILLIS_CONFIG_KEY) ? config.getInt(IDLE_TIMEOUT_MILLIS_CONFIG_KEY) : 60000;
9191
final int stopTimeout = config.hasPath(STOP_TIMEOUT_MILLIS_CONFIG_KEY) ? config.getInt(STOP_TIMEOUT_MILLIS_CONFIG_KEY) : 30000;
9292
final int gzipBufferSize = config.hasPath(GZIP_BUFFER_SIZE) ? config.getInt(GZIP_BUFFER_SIZE) : 16384;
93-
final boolean gzipEnabled = config.hasPath(GZIP_ENABLED_KEY) && config.getBoolean(GZIP_ENABLED_KEY);
93+
final boolean gzipEnabled = !config.hasPath(GZIP_ENABLED_KEY) || config.getBoolean(GZIP_ENABLED_KEY); // default is true
9494
return new HttpConfig(port, minThreads, maxThreads, idleTimeout, stopTimeout, gzipEnabled, gzipBufferSize);
9595
}
9696
}

agent-providers/span/src/test/scala/com/expedia/www/haystack/agent/pitchfork/HttpConfigSpec.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import scala.collection.JavaConverters._
1111

1212
class HttpConfigSpec extends FunSpec with Matchers with EasyMockSugar {
1313
describe("Http configuration provider") {
14-
it("should return gzip enabled as true if provided and its value is 'true'") {
15-
val config = ConfigFactory.parseMap(Map("port" -> 9115, "http.threads.min" -> 2, "http.threads.max" -> 4, "gzip.enabled" -> true).asJava)
14+
it("should return gzip enabled as false if provided and its value is 'false'") {
15+
val config = ConfigFactory.parseMap(Map("port" -> 9115, "http.threads.min" -> 2, "http.threads.max" -> 4, "gzip.enabled" -> false).asJava)
1616
val httpConfig = HttpConfig.from(config)
17-
httpConfig.isGzipEnabled should equal (true)
17+
httpConfig.isGzipEnabled should equal (false)
1818
}
19-
it("should return gzip enabled as false if not provided") {
19+
it("should return gzip enabled as true if not provided") {
2020
val config = ConfigFactory.parseMap(Map("port" -> 9115, "http.threads.min" -> 2, "http.threads.max" -> 4).asJava)
2121
val httpConfig = HttpConfig.from(config)
22-
httpConfig.isGzipEnabled should equal (false)
22+
httpConfig.isGzipEnabled should equal (true)
2323
}
2424
it("should return gzip buffer as 16Kb if not provided") {
2525
val config = ConfigFactory.parseMap(Map("port" -> 9115, "http.threads.min" -> 2, "http.threads.max" -> 4).asJava)

docker/default.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ agents {
3737
max = 16
3838
min = 2
3939
}
40+
gzip.enabled = true
4041
idle.timeout.ms = 60000
4142
stop.timeout.ms = 30000
4243
accept.null.timestamps = false
@@ -51,4 +52,4 @@ agents {
5152
}
5253
}
5354
}
54-
}
55+
}

0 commit comments

Comments
 (0)