Compare commits

..

6 Commits

8 changed files with 16 additions and 8 deletions

2
build
View File

@@ -1 +1 @@
63
65

View File

@@ -9,7 +9,7 @@ fullnameOverride: ""
images:
owgw:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
tag: master
tag: v3.0.0-RC2
pullPolicy: Always
# regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io

View File

@@ -58,7 +58,7 @@ namespace OpenWifi {
}
StateUtils::ComputeAssociations(StateObj, State_.Associations_2G,
State_.Associations_5G, State_.Associations_6G);
State_.Associations_5G, State_.Associations_6G, State_.uptime);
if (KafkaManager()->Enabled() && !AP_WS_Server()->KafkaDisableState()) {
KafkaManager()->PostMessage(KafkaTopics::STATE, SerialNumber_, *ParamsObj);

View File

@@ -276,6 +276,7 @@ namespace OpenWifi::GWObjects {
field_to_json(Obj, "totalConnectionTime", Utils::Now() - started);
field_to_json(Obj, "certificateExpiryDate", certificateExpiryDate);
field_to_json(Obj, "connectReason", connectReason);
field_to_json(Obj, "uptime", uptime);
#ifdef TIP_GATEWAY_SERVICE
hasRADIUSSessions = RADIUSSessionTracker()->HasSessions(SerialNumber);

View File

@@ -49,6 +49,7 @@ namespace OpenWifi::GWObjects {
std::double_t load=0.0;
std::double_t temperature=0.0;
std::string connectReason;
std::uint64_t uptime=0;
void to_json(const std::string &SerialNumber, Poco::JSON::Object &Obj) ;
};

View File

@@ -24,7 +24,7 @@ namespace OpenWifi::StateUtils {
}
bool ComputeAssociations(const Poco::JSON::Object::Ptr RawObject, uint64_t &Radios_2G,
uint64_t &Radios_5G, uint64_t &Radios_6G) {
uint64_t &Radios_5G, uint64_t &Radios_6G, uint64_t &UpTime ) {
Radios_2G = 0;
Radios_5G = 0;
Radios_6G = 0;
@@ -90,9 +90,15 @@ namespace OpenWifi::StateUtils {
}
}
}
// std::cout << Radios_2G << " " << Radios_5G << " " << Radios_6G << std::endl;
return true;
}
if(RawObject->has("unit") && !RawObject->isNull("unit") && RawObject->isObject("unit")) {
auto unit = RawObject->getObject("unit");
if(unit->has("uptime")) {
UpTime = unit->get("uptime");
}
}
return false;
}
} // namespace OpenWifi::StateUtils

View File

@@ -8,5 +8,5 @@
namespace OpenWifi::StateUtils {
bool ComputeAssociations(const Poco::JSON::Object::Ptr RawObject, uint64_t &Radios_2G,
uint64_t &Radios_5G, uint64_t &Radio_6G);
uint64_t &Radios_5G, uint64_t &Radio_6G, uint64_t &UpTime);
}

View File

@@ -1056,9 +1056,9 @@ namespace OpenWifi {
}
}
uint64_t Associations_2G, Associations_5G, Associations_6G;
uint64_t Associations_2G, Associations_5G, Associations_6G, uptime;
StateUtils::ComputeAssociations(RawObject, Associations_2G, Associations_5G,
Associations_6G);
Associations_6G, uptime);
UpdateCountedMap(Dashboard.associations, "2G", Associations_2G);
UpdateCountedMap(Dashboard.associations, "5G", Associations_5G);
UpdateCountedMap(Dashboard.associations, "6G", Associations_6G);