From c1f39fbf57e524f96aade0f0c64e495b5329b023 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 22 Dec 2022 21:27:59 +0100 Subject: [PATCH] Dashboard/Customization Buffer 16k, measure and and log size. --- src/web/WebCustomizationService.cpp | 5 +++-- src/web/WebDataService.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/web/WebCustomizationService.cpp b/src/web/WebCustomizationService.cpp index 0dffaf843..e707d7d6c 100644 --- a/src/web/WebCustomizationService.cpp +++ b/src/web/WebCustomizationService.cpp @@ -200,7 +200,7 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) { // send back list of device entities void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) { if (json.is()) { - auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXXLARGE_DYN); + auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXLARGE_DYN); if (!response->getSize()) { delete response; response = new MsgpackAsyncJsonResponse(true, 256); @@ -215,7 +215,8 @@ void WebCustomizationService::device_entities(AsyncWebServerRequest * request, J JsonArray output = response->getRoot(); emsdevice->generate_values_web_customization(output); #endif - response->setLength(); + size_t length = response->setLength(); + EMSESP::logger().debug("Customization buffer used: %d", length); request->send(response); return; } diff --git a/src/web/WebDataService.cpp b/src/web/WebDataService.cpp index f708b8528..9fc99bc95 100644 --- a/src/web/WebDataService.cpp +++ b/src/web/WebDataService.cpp @@ -165,7 +165,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) { // Compresses the JSON using MsgPack https://msgpack.org/index.html void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) { if (json.is()) { - auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXXLARGE_DYN); + auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN); if (!response->getSize()) { delete response; response = new MsgpackAsyncJsonResponse(false, 256); @@ -192,7 +192,8 @@ void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & // #endif // #endif - response->setLength(); + size_t length = response->setLength(); + EMSESP::logger().debug("Dashboard buffer used: %d", length); request->send(response); return; }