We have a Real-Time SDK application that has the following:
class ConsumerClient : public access::OmmConsumerClient {
public:
ConsumerClient(…) { … }
protected:
void onRefreshMsg(const access::RefreshMsg &msg,
const access::OmmConsumerEvent &event) {
processState(msg.getState());
}
void onUpdateMsg(const access::UpdateMsg &msg,
const access::OmmConsumerEvent &event) {
processMsg(msg);
}
void onStatusMsg(const access::StatusMsg &msg,
const access::OmmConsumerEvent &event) {
if (msg.hasState()) {
processState(msg.getState());
}
}
private:
void processState(const access::OmmState &state) {
switch (state.getStreamState()) {
case access::OmmState::StreamState::OpenEnum:
if (state.getDataState() == access::OmmState::DataState::OkEnum) {
inc_lseg_connections(*outbound_channel);
}
break;
default:
inc_lseg_disconnections(*outbound_channel);
break;
}
}
We have alerting on inc_lseg_connections and dec_lseg_connections. Occasionally, we get spurious alerting relating to inc_lseg_connections during the day, hours after the initial channel ups without having any disconnections.Really, what we want is to be able to determine if the connection is active at any given time. What is the best way to do that?