1 | if (timeThreshold != -1) {↵ | | 1 | if (timeThreshold != -1) {↵
|
2 | SampleResult sr = e.getResult();↵ | | 2 | ↵
|
3 | long timestamp = sr.getTimeStamp();↵ | | 3 | long now = System.currentTimeMillis();↵
|
|
4 | // Checking for and creating initial timestamp to cheak against↵ | | 4 | // Checking for and creating initial timestamp to cheak against↵
|
5 | if (batchSendTime == -1) {↵ | | 5 | if (batchSendTime == -1) {↵
|
6 | this.batchSendTime = timestamp + timeThreshold;↵ | | 6 | this.batchSendTime = now + timeThreshold;↵
|
7 | }↵ | | 7 | }↵
|
|
8 | if (batchSendTime < timestamp) {↵ | | 8 | if (batchSendTime < now) {↵
|
9 | try {↵ | | 9 | try {↵
|
10 | ↵ | | 10 | if (log.isDebugEnabled()) {↵
|
11 | log.debug("Firing time");↵ | | 11 | log.debug("Firing time");↵
|
12 | if (sampleStore.size() > 0) {↵ | | 12 | ↵
|
13 | listener.processBatch(sampleStore);↵ | | |
|
14 | sampleStore.clear();↵ | | |
|
15 | }↵ | | 13 | }↵
|
| | | 14 | sendBatch();↵
|
16 | this.batchSendTime = timestamp + timeThreshold;↵ | | 15 | this.batchSendTime = now + timeThreshold;↵
|
17 | } catch (RemoteException err) {↵ | | 16 | } catch (RemoteException err) {↵
|
18 | log.error("sampleOccurred", err);↵ | | 17 | log.warn("sampleOccurred", err);↵
|
19 | }↵ | | 18 | }↵
|
20 | }↵ | | 19 | }↵
|
21 | } | | 20 | }
|