parent
f013698471
commit
638f52a8da
@ -81,6 +81,22 @@ void WebApiPrometheusClass::onPrometheusMetricsGet(AsyncWebServerRequest* reques
|
||||
stream->printf("opendtu_last_update{serial=\"%s\",unit=\"%d\",name=\"%s\"} %d\n",
|
||||
serial.c_str(), i, name, inv->Statistics()->getLastUpdate() / 1000);
|
||||
|
||||
if (i == 0) {
|
||||
stream->print("# HELP opendtu_inverter_limit_relative current relative limit of the inverter\n");
|
||||
stream->print("# TYPE opendtu_inverter_limit_relative gauge\n");
|
||||
}
|
||||
stream->printf("opendtu_inverter_limit_relative{serial=\"%s\",unit=\"%d\",name=\"%s\"} %f\n",
|
||||
serial.c_str(), i, name, inv->SystemConfigPara()->getLimitPercent() / 100.0);
|
||||
|
||||
if (inv->DevInfo()->getMaxPower() > 0) {
|
||||
if (i == 0) {
|
||||
stream->print("# HELP opendtu_inverter_limit_absolute current relative limit of the inverter\n");
|
||||
stream->print("# TYPE opendtu_inverter_limit_absolute gauge\n");
|
||||
}
|
||||
stream->printf("opendtu_inverter_limit_absolute{serial=\"%s\",unit=\"%d\",name=\"%s\"} %f\n",
|
||||
serial.c_str(), i, name, inv->SystemConfigPara()->getLimitPercent() * inv->DevInfo()->getMaxPower() / 100.0);
|
||||
}
|
||||
|
||||
// Loop all channels if Statistics have been updated at least once since DTU boot
|
||||
if (inv->Statistics()->getLastUpdate() > 0) {
|
||||
for (auto& t : inv->Statistics()->getChannelTypes()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user