mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
enable statistics payload compression
(cherry picked from commit10b2bc0317) (cherry picked from commitd7a05b205c)
This commit is contained in:
committed by
Nikita Iarychenko
parent
16ff8fea4c
commit
53aa5e858a
@@ -123,7 +123,7 @@ public class EventLogStatisticsService implements StatisticsService {
|
||||
try {
|
||||
logger.info("Statistics. Starting sending " + file.getName() + " to " + serviceUrl);
|
||||
StatsHttpRequests.post(serviceUrl, connectionSettings).
|
||||
withBody(LogEventSerializer.INSTANCE.toString(recordRequest), "application/json", StandardCharsets.UTF_8).
|
||||
withBody(LogEventSerializer.INSTANCE.toString(recordRequest), "application/octet-stream", StandardCharsets.UTF_8).
|
||||
succeed((r, code) -> {
|
||||
toRemove.add(file);
|
||||
decorator.onSucceed(recordRequest, loadAndLogResponse(logger, r, file), file.getAbsolutePath());
|
||||
|
||||
@@ -176,10 +176,8 @@ public class StatsRequestBuilder {
|
||||
}
|
||||
builder.setHeader("Chunked", Boolean.toString(false));
|
||||
builder.setHeader("Content-Type", String.format(Locale.ENGLISH, "%s; charset=%s", myContentType, myCharset));
|
||||
// temporarily disable compression due to YC issues
|
||||
//builder.setHeader("Content-Encoding", "gzip");
|
||||
//builder.POST(HttpRequest.BodyPublishers.ofByteArray(getCompressedContent()));
|
||||
builder.POST(HttpRequest.BodyPublishers.ofString(myContent, myCharset));
|
||||
builder.setHeader("Content-Encoding", "gzip");
|
||||
builder.POST(HttpRequest.BodyPublishers.ofByteArray(getCompressedContent()));
|
||||
}
|
||||
else if ("GET".equals(myMethod)) {
|
||||
builder.GET();
|
||||
|
||||
Reference in New Issue
Block a user