summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorsunil.unnava <sunil.unnava@att.com>2019-04-03 00:41:55 -0400
committersunil.unnava <sunil.unnava@att.com>2019-04-03 00:43:04 -0400
commit34615204bca86d54ebfbedb15e8976515688c56c (patch)
tree7ff972385359fe1a4d64fbc52bbc069b9301d618 /src/main/java
parent49924c6b07a7f9418f04d09f9c94fac8e7d44485 (diff)
add testcases
Issue-ID: DMAAP-1140 Change-Id: I249cf7b1b7f0692de224aee9b33aab8dbab20054 Signed-off-by: sunil.unnava <sunil.unnava@att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java b/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java
index 2091e5f..f645c8d 100644
--- a/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java
+++ b/src/main/java/org/onap/dmaap/dmf/mr/beans/DMaaPCambriaLimiter.java
@@ -52,7 +52,6 @@ import com.att.nsa.metrics.impl.CdmRateTicker;
@Component
public class DMaaPCambriaLimiter {
private final HashMap<String, RateInfo> fRateInfo;
- private final HashMap<String, RateInfoCheck> fRateInfoCheck;
private final double fMaxEmptyPollsPerMinute;
private final double fMaxPollsPerMinute;
private final int fWindowLengthMins;
@@ -70,7 +69,6 @@ public class DMaaPCambriaLimiter {
@Autowired
public DMaaPCambriaLimiter(@Qualifier("propertyReader") rrNvReadable settings) {
fRateInfo = new HashMap<>();
- fRateInfoCheck = new HashMap<>();
fMaxEmptyPollsPerMinute = settings.getDouble(CambriaConstants.kSetting_MaxEmptyPollsPerMinute,
CambriaConstants.kDefault_MaxEmptyPollsPerMinute);
fMaxPollsPerMinute = settings.getDouble(CambriaConstants.kSetting_MaxPollsPerMinute,
@@ -105,7 +103,6 @@ public class DMaaPCambriaLimiter {
*/
public DMaaPCambriaLimiter(double maxEmptyPollsPerMinute,double maxPollsPerMinute, int windowLengthMins, long sleepMs ,long sleepMS1) {
fRateInfo = new HashMap<>();
- fRateInfoCheck = new HashMap<>();
fMaxEmptyPollsPerMinute = Math.max(0, maxEmptyPollsPerMinute);
fMaxPollsPerMinute = Math.max(0, maxPollsPerMinute);
fWindowLengthMins = windowLengthMins;
@@ -226,42 +223,6 @@ public class DMaaPCambriaLimiter {
- private static class RateInfoCheck {
-
- private final String fLabel;
- private final CdmRateTicker fCallRateSinceLastMsgSend;
- /**
- * constructor initialzes
- *
- * @param label
- * @param windowLengthMinutes
- */
- public RateInfoCheck(String label, int windowLengthMinutes) {
- fLabel = label;
- fCallRateSinceLastMsgSend = new CdmRateTicker("Call rate since last msg send", 1, TimeUnit.MINUTES,
- windowLengthMinutes, TimeUnit.MINUTES);
- }
-
- public String getLabel() {
- return fLabel;
- }
-
- /**
- * CdmRateTicker is reset
- */
- public void reset() {
- fCallRateSinceLastMsgSend.reset();
- }
-
- /**
- *
- * @return
- */
- public double onCall() {
- fCallRateSinceLastMsgSend.tick();
- return fCallRateSinceLastMsgSend.getRate();
- }
- }