Statistics
This commit is contained in:
parent
e2a505f780
commit
39ca767847
@ -7,7 +7,7 @@ public class ElectricEnergyDataObject extends ADataObject {
|
||||
static final String ENERGY_KEY = "energy";
|
||||
static final String POWER_KEY = "power";
|
||||
static final String TABLE_NAME = "ElectricEnergy";
|
||||
static final String KIND_NAME = "ElectricEnergy";
|
||||
static final String KIND_NAME = "ElectricEnergy";
|
||||
|
||||
public ElectricEnergyDataObject(String name, double energy, double power) {
|
||||
super(name, KIND_NAME);
|
||||
|
@ -67,6 +67,7 @@ public class MbusScheduledQuerier extends Thread {
|
||||
}
|
||||
}
|
||||
logger.info("Cnt: " + cnt + ", SuccessCnt: " + successCnt + ", ErrCnt: " + errCnt);
|
||||
this.queue.add(new MbusStatisticsDataObject("MbusgwChild", cnt, errCnt, successCnt));
|
||||
try {
|
||||
Thread.sleep(5*1000);
|
||||
} 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user