use of org.mobicents.protocols.ss7.oam.common.statistics.api.CounterDef in project smscgateway by RestComm.
the class SmscStatProviderJmx method setupCounterList.
private void setupCounterList() {
FastMap<String, CounterDefSet> lst = new FastMap<String, CounterDefSet>();
CounterDefSetImpl cds = new CounterDefSetImpl(this.getCounterMediatorName() + "-Main");
lst.put(cds.getName(), cds);
CounterDef cd = new CounterDefImpl(CounterType.Minimal, "MinMessagesInProcess", "A min count of messages that are in progress during a period");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Maximal, "MaxMessagesInProcess", "A max count of messages that are in progress during a period");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInReceivedAll", "Messages received and accepted via all interfaces");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInRejectedAll", "Messages received and rejected because of charging reject via all interfaces");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInFailedAll", "Messages received and failed to process via all interfaces");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInReceivedSs7", "Messages received and accepted via SS7 interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInReceivedSs7Mo", "Messages received and accepted via SS7 interface (mobile originated)");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInReceivedSs7Hr", "Messages received and accepted via SS7 interface (home routing)");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "HomeRoutingCorrIdFail", "Home routing failures because of absent correlationId");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "SmppSecondRateOverlimitFail", "Rejecting of incoming SMPP messages case because of exceeding of a rate limit per a second");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "SmppMinuteRateOverlimitFail", "Rejecting of incoming SMPP messages case because of exceeding of a rate limit per a minute");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "SmppHourRateOverlimitFail", "Rejecting of incoming SMPP messages case because of exceeding of a rate limit per a hour");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "SmppDayRateOverlimitFail", "Rejecting of incoming SMPP messages case because of exceeding of a rate limit per a day");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInReceivedSmpp", "Messages received and accepted via SMPP interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInReceivedSip", "Messages received and accepted via SIP interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary_Cumulative, "MsgInReceivedAllCumulative", "Messages received and accepted via all interfaces cumulative");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInHrSriReq", "Home routing SRI messages received");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInHrSriPosReq", "Home routing SRI positive responses");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInHrSriHrByPass", "ByPass HomeRouting procedure after SRI to a local HLR");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgInHrSriNegReq", "Home routing SRI negative responses");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutTryAll", "Messages sending tries via all interfaces");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutSentAll", "Messages sent via all interfaces");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary_Cumulative, "MsgOutTryAllCumulative", "Messages sending tries via all interfaces cumulative");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary_Cumulative, "MsgOutSentAllCumulative", "Messages sent via all interfaces cumulative");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutFailedAll", "Messages failed to send via all interfaces");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Average, "MsgOutTryAllPerSec", "Messages sending tries via all interfaces per second");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Average, "MsgOutSentAllPerSec", "Messages sent via all interfaces per second");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutTrySs7", "Messages sending tries via SS7 interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutSentSs7", "Messages sent via SS7 interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutTrySmpp", "Messages sending tries via SMPP interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutSentSmpp", "Messages sent via SMPP interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutTrySip", "Messages sending tries via SIP interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary, "MsgOutSentSip", "Messages sent via SIP interface");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Summary_Cumulative, "SmscDeliveringLag", "Lag of delivering messages by Smsc (in seconds)");
cds.addCounterDef(cd);
cd = new CounterDefImpl(CounterType.Maximal, "MsgPendingInDb", "Messages stored in database which are to be delivered yet");
cds.addCounterDef(cd);
lstCounters = lst;
}
use of org.mobicents.protocols.ss7.oam.common.statistics.api.CounterDef in project smscgateway by RestComm.
the class SmscStatProviderJmx method getSourceValueSet.
@Override
public SourceValueSet getSourceValueSet(String counterDefSetName, String campaignName, int durationInSeconds) {
if (durationInSeconds >= 60)
logger.info("getSourceValueSet() - starting - campaignName=" + campaignName);
else
logger.debug("getSourceValueSet() - starting - campaignName=" + campaignName);
long curTimeSeconds = new Date().getTime() / 1000;
SourceValueSetImpl svs;
try {
String[] csl = this.getCounterDefSetList();
if (!csl[0].equals(counterDefSetName))
return null;
svs = new SourceValueSetImpl(smscStatAggregator.getSessionId());
CounterDefSet cds = getCounterDefSet(counterDefSetName);
for (CounterDef cd : cds.getCounterDefs()) {
SourceValueCounterImpl scs = new SourceValueCounterImpl(cd);
SourceValueObjectImpl svo = null;
if (cd.getCounterName().equals("MsgInReceivedAll")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedAll());
} else if (cd.getCounterName().equals("MsgInRejectedAll")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInRejectedAll());
} else if (cd.getCounterName().equals("MsgInFailedAll")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInFailedAll());
} else if (cd.getCounterName().equals("MsgInReceivedSs7")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedSs7());
} else if (cd.getCounterName().equals("MsgInReceivedSs7Mo")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedSs7Mo());
} else if (cd.getCounterName().equals("MsgInReceivedSs7Hr")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedSs7Hr());
} else if (cd.getCounterName().equals("HomeRoutingCorrIdFail")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getHomeRoutingCorrIdFail());
} else if (cd.getCounterName().equals("SmppSecondRateOverlimitFail")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getSmppSecondRateOverlimitFail());
} else if (cd.getCounterName().equals("SmppMinuteRateOverlimitFail")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getSmppMinuteRateOverlimitFail());
} else if (cd.getCounterName().equals("SmppHourRateOverlimitFail")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getSmppHourRateOverlimitFail());
} else if (cd.getCounterName().equals("SmppDayRateOverlimitFail")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getSmppDayRateOverlimitFail());
} else if (cd.getCounterName().equals("MsgInReceivedSmpp")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedSmpp());
} else if (cd.getCounterName().equals("MsgInReceivedSip")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedSip());
} else if (cd.getCounterName().equals("MsgInReceivedAllCumulative")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInReceivedAllCumulative());
} else if (cd.getCounterName().equals("MsgInHrSriReq")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInHrSriReq());
} else if (cd.getCounterName().equals("MsgInHrSriPosReq")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInHrSriPosReq());
} else if (cd.getCounterName().equals("MsgInHrSriHrByPass")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInHrSriHrByPass());
} else if (cd.getCounterName().equals("MsgInHrSriNegReq")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgInHrSriNegReq());
} else if (cd.getCounterName().equals("MsgOutTryAll")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutTryAll());
} else if (cd.getCounterName().equals("MsgOutSentAll")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutSentAll());
} else if (cd.getCounterName().equals("MsgOutTryAllCumulative")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutTryAllCumulative());
} else if (cd.getCounterName().equals("MsgOutSentAllCumulative")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutSentAllCumulative());
} else if (cd.getCounterName().equals("MsgOutFailedAll")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutFailedAll());
} else if (cd.getCounterName().equals("MsgOutTryAllPerSec")) {
long cnt = smscStatAggregator.getMsgOutTryAll();
svo = new SourceValueObjectImpl(this.getName(), 0);
svo.setValueA(cnt);
svo.setValueB(curTimeSeconds);
} else if (cd.getCounterName().equals("MsgOutSentAllPerSec")) {
long cnt = smscStatAggregator.getMsgOutSentAll();
svo = new SourceValueObjectImpl(this.getName(), 0);
svo.setValueA(cnt);
svo.setValueB(curTimeSeconds);
} else if (cd.getCounterName().equals("MsgOutTrySs7")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutTrySs7());
} else if (cd.getCounterName().equals("MsgOutSentSs7")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutSentSs7());
} else if (cd.getCounterName().equals("MsgOutTrySmpp")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutTrySmpp());
} else if (cd.getCounterName().equals("MsgOutSentSmpp")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutSentSmpp());
} else if (cd.getCounterName().equals("MsgOutTrySip")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutTrySip());
} else if (cd.getCounterName().equals("MsgOutSentSip")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgOutSentSip());
} else if (cd.getCounterName().equals("MinMessagesInProcess")) {
Long res = smscStatAggregator.getMinMessagesInProcess(campaignName);
if (res != null)
svo = new SourceValueObjectImpl(this.getName(), res);
} else if (cd.getCounterName().equals("MaxMessagesInProcess")) {
Long res = smscStatAggregator.getMaxMessagesInProcess(campaignName);
if (res != null)
svo = new SourceValueObjectImpl(this.getName(), res);
} else if (cd.getCounterName().equals("SmscDeliveringLag")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getSmscDeliveringLag());
} else if (cd.getCounterName().equals("MsgPendingInDb")) {
svo = new SourceValueObjectImpl(this.getName(), smscStatAggregator.getMsgPendingInDbRes());
}
if (svo != null)
scs.addObject(svo);
svs.addCounter(scs);
}
} catch (Throwable e) {
logger.info("Exception when getSourceValueSet() - campaignName=" + campaignName + " - " + e.getMessage(), e);
return null;
}
if (durationInSeconds >= 60)
logger.info("getSourceValueSet() - return value - campaignName=" + campaignName);
else
logger.debug("getSourceValueSet() - return value - campaignName=" + campaignName);
return svs;
}
Aggregations