Skip to content

Commit c1f39fb

Browse files
committed
Dashboard/Customization Buffer 16k, measure and and log size.
1 parent f66e771 commit c1f39fb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/web/WebCustomizationService.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
200200
// send back list of device entities
201201
void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) {
202202
if (json.is<JsonObject>()) {
203-
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXXLARGE_DYN);
203+
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXLARGE_DYN);
204204
if (!response->getSize()) {
205205
delete response;
206206
response = new MsgpackAsyncJsonResponse(true, 256);
@@ -215,7 +215,8 @@ void WebCustomizationService::device_entities(AsyncWebServerRequest * request, J
215215
JsonArray output = response->getRoot();
216216
emsdevice->generate_values_web_customization(output);
217217
#endif
218-
response->setLength();
218+
size_t length = response->setLength();
219+
EMSESP::logger().debug("Customization buffer used: %d", length);
219220
request->send(response);
220221
return;
221222
}

src/web/WebDataService.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
165165
// Compresses the JSON using MsgPack https://msgpack.org/index.html
166166
void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) {
167167
if (json.is<JsonObject>()) {
168-
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXXLARGE_DYN);
168+
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN);
169169
if (!response->getSize()) {
170170
delete response;
171171
response = new MsgpackAsyncJsonResponse(false, 256);
@@ -192,7 +192,8 @@ void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant &
192192
// #endif
193193
// #endif
194194

195-
response->setLength();
195+
size_t length = response->setLength();
196+
EMSESP::logger().debug("Dashboard buffer used: %d", length);
196197
request->send(response);
197198
return;
198199
}

0 commit comments

Comments
 (0)