mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Dashboard/Customization Buffer 16k, measure and and log size.
This commit is contained in:
@@ -200,7 +200,7 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
|||||||
// send back list of device entities
|
// send back list of device entities
|
||||||
void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||||
if (json.is<JsonObject>()) {
|
if (json.is<JsonObject>()) {
|
||||||
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXXLARGE_DYN);
|
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||||
if (!response->getSize()) {
|
if (!response->getSize()) {
|
||||||
delete response;
|
delete response;
|
||||||
response = new MsgpackAsyncJsonResponse(true, 256);
|
response = new MsgpackAsyncJsonResponse(true, 256);
|
||||||
@@ -215,7 +215,8 @@ void WebCustomizationService::device_entities(AsyncWebServerRequest * request, J
|
|||||||
JsonArray output = response->getRoot();
|
JsonArray output = response->getRoot();
|
||||||
emsdevice->generate_values_web_customization(output);
|
emsdevice->generate_values_web_customization(output);
|
||||||
#endif
|
#endif
|
||||||
response->setLength();
|
size_t length = response->setLength();
|
||||||
|
EMSESP::logger().debug("Customization buffer used: %d", length);
|
||||||
request->send(response);
|
request->send(response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
|||||||
// Compresses the JSON using MsgPack https://msgpack.org/index.html
|
// Compresses the JSON using MsgPack https://msgpack.org/index.html
|
||||||
void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) {
|
void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||||
if (json.is<JsonObject>()) {
|
if (json.is<JsonObject>()) {
|
||||||
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXXLARGE_DYN);
|
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||||
if (!response->getSize()) {
|
if (!response->getSize()) {
|
||||||
delete response;
|
delete response;
|
||||||
response = new MsgpackAsyncJsonResponse(false, 256);
|
response = new MsgpackAsyncJsonResponse(false, 256);
|
||||||
@@ -192,7 +192,8 @@ void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant &
|
|||||||
// #endif
|
// #endif
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
response->setLength();
|
size_t length = response->setLength();
|
||||||
|
EMSESP::logger().debug("Dashboard buffer used: %d", length);
|
||||||
request->send(response);
|
request->send(response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user