From 10b2bc03175e2d75f478eaf91c2554ee5ed662e4 Mon Sep 17 00:00:00 2001 From: Dmitry Lyubin Date: Thu, 21 Aug 2025 16:42:59 +0300 Subject: [PATCH] enable statistics payload compression --- .../eventLog/connection/EventLogStatisticsService.java | 2 +- .../eventLog/connection/request/StatsRequestBuilder.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/EventLogStatisticsService.java b/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/EventLogStatisticsService.java index 8a57b415aaf0..3bcd4d2e3d95 100644 --- a/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/EventLogStatisticsService.java +++ b/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/EventLogStatisticsService.java @@ -120,7 +120,7 @@ public class EventLogStatisticsService implements StatisticsService { try { 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()); diff --git a/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/request/StatsRequestBuilder.java b/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/request/StatsRequestBuilder.java index fb224dd905e9..3fbe22113a71 100644 --- a/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/request/StatsRequestBuilder.java +++ b/platform/statistics/uploader/src/com/intellij/internal/statistic/eventLog/connection/request/StatsRequestBuilder.java @@ -175,10 +175,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();