@@ -0,0 +1,1291 @@
+package com.boundary.sdk.event.snmp;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.Random;%0A%0Apublic class SNMPDerivative %7B%0A%09%0A%09public SNMPGauge gauge = new SNMPGauge();%0A%09%0A%09public class SNMPGauge %7B%0A%09%09%0A%09%09private final int RANGE= 100;%0A%09%09%0A%09%09private Random random = new Random(1L);%0A%09%09%0A%09%09private int value;%0A%09%09%0A%09%09SNMPGauge() %7B%0A%09%09%09value = random.nextInt(RANGE);%0A%09%09%7D%0A%09%09%0A%09%09int getValue() %7B%0A%09%09%09return value;%0A%09%09%7D%0A%09%09%0A%09%09int next() %7B%0A%09%09%09value = value + random.nextInt(RANGE);%0A%09%09%09return value;%0A%09%09%7D%0A%09%7D;%0A%09%0A%09class SNMPSample %7B%0A%09%09private String key;%0A%09%09private int value;%0A%09%09public String getKey() %7B%0A%09%09%09return key;%0A%09%09%7D%0A%09%09public void setKey(String key) %7B%0A%09%09%09this.key = key;%0A%09%09%7D%0A%09%09public int getValue() %7B%0A%09%09%09return value;%0A%09%09%7D%0A%09%09public void setValue(int value) %7B%0A%09%09%09this.value = value;%0A%09%09%7D%0A%09%7D;%0A%0A%09private Map derivative = new HashMap%3CString,SNMPSample%3E();%0A%09%0A%09public long getDelta(String key,long value) %7B%0A%09%09Long newValue = Long.valueOf(value);%0A%09%09return 0;%0A%09%7D%0A%09%0A%09public static void main(String %5B%5D args) %7B%0A%09%09SNMPDerivative d = new SNMPDerivative();%0A%09%09SNMPGauge gauge = d.gauge;%0A%09%09long lastValue = 0;%0A%0A%09%09for (int i=100 ; i != 0 ; i--) %7B%0A%09%09%09long value = gauge.getValue();%0A%09%09%09System.out.println(%22value: %22 + value + %22, diff: %22 + (value - lastValue));%0A%09%09%09lastValue = value;%0A%09%09%09gauge.next();%0A%09%09%7D%0A%09%7D%0A%7D%0A%0A%0A%0A%0A%0A%0A

Work in progress for handling SNMP counters