Statistics
This commit is contained in:
@ -67,6 +67,7 @@ public class MbusScheduledQuerier extends Thread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("Cnt: " + cnt + ", SuccessCnt: " + successCnt + ", ErrCnt: " + errCnt);
|
logger.info("Cnt: " + cnt + ", SuccessCnt: " + successCnt + ", ErrCnt: " + errCnt);
|
||||||
|
this.queue.add(new MbusStatisticsDataObject("MbusgwChild", cnt, errCnt, successCnt));
|
||||||
try {
|
try {
|
||||||
Thread.sleep(5*1000);
|
Thread.sleep(5*1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package de.hottis.mbusMaster;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class MbusStatisticsDataObject extends ADataObject {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
static final String TOTAL_CNT_KEY = "total";
|
||||||
|
static final String ERROR_CNT_KEY = "error";
|
||||||
|
static final String SUCCESS_CNT_KEY = "success";
|
||||||
|
static final String TABLE_NAME = "Statistics";
|
||||||
|
static final String KIND_NAME = "Statistics";
|
||||||
|
|
||||||
|
public MbusStatisticsDataObject(String name, int total, int error, int success) {
|
||||||
|
super(name, KIND_NAME);
|
||||||
|
HashMap<String, Object> values = new HashMap<String, Object>();
|
||||||
|
values.put(TOTAL_CNT_KEY, total);
|
||||||
|
values.put(ERROR_CNT_KEY, error);
|
||||||
|
values.put(SUCCESS_CNT_KEY, success);
|
||||||
|
setValues(values);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTableName() {
|
||||||
|
return TABLE_NAME;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user