Browse Source

TT#14008 fix MQTT global stats

The JSON context is already in an object, therefore skip the surrounding
{} enclosure.

Also don't run the global MQTT timer when MQTT is disabled.

closes #1290

Change-Id: I63c622bd339545e625ee18def33f21de2533f949
pull/1347/head
Richard Fuchs 5 years ago
parent
commit
aeb0b7bcee
2 changed files with 8 additions and 1 deletions
  1. +2
    -1
      daemon/call.c
  2. +6
    -0
      daemon/mqtt.c

+ 2
- 1
daemon/call.c View File

@ -725,7 +725,8 @@ int call_init() {
poller_add_timer(rtpe_poller, call_timer, NULL);
mqtt_timer_start(&global_mqtt_timer, NULL, NULL);
if (mqtt_publish_scope() != MPS_NONE)
mqtt_timer_start(&global_mqtt_timer, NULL, NULL);
return 0;
}


+ 6
- 0
daemon/mqtt.c View File

@ -388,6 +388,12 @@ static void mqtt_global_stats(JsonBuilder *json) {
if (!m->label)
continue;
if (m->is_bracket && l == metrics->head) // skip initial {
continue;
if (m->is_bracket && l == metrics->tail) // skip final }
continue;
if (m->value_short) {
json_builder_set_member_name(json, m->label);
if (m->is_int)


Loading…
Cancel
Save