Skip to content

Commit 84729e3

Browse files
author
robbins
committed
Revert to StringDataBucket for now
1 parent c5ff1a7 commit 84729e3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

java/src/com/ibm/javametrics/agent/JavaAgent.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ public void pushData(String type, String data) {
5151
synchronized (buckets) {
5252
Bucket bucket = buckets.get(type);
5353
if (bucket == null) {
54-
bucket = new ArrayDataBucket(MAX_BUCKET_SIZE);
54+
bucket = new StringDataBucket(MAX_BUCKET_SIZE);
5555
buckets.put(type, bucket);
5656
}
57-
bucket.addData(data);
57+
if (!bucket.addData(data)) {
58+
// System.err.println("Javametrics: data dropped. Bucket size="
59+
// + bucket.getSize());
60+
}
5861
}
5962
}
6063

@@ -86,7 +89,7 @@ private void drainBatched(String type, Bucket bucket) {
8689
emit(type, sb.toString());
8790
}
8891
}
89-
92+
9093
private void emit(String type, String data) {
9194
if (data != null) {
9295
receivers.forEach((receiver) -> {

0 commit comments

Comments
 (0)