@@ -33,15 +33,15 @@ class BucketDiagnostics {
33
33
private long latestFlushedBucketStartMs = -1 ;
34
34
private final BucketFlushListener bucketFlushListener ;
35
35
36
- public BucketDiagnostics (Job job , BucketFlushListener bucketFlushListener ) {
36
+ BucketDiagnostics (Job job , BucketFlushListener bucketFlushListener ) {
37
37
bucketSpanMs = job .getAnalysisConfig ().getBucketSpan ().millis ();
38
38
latencyMs = job .getAnalysisConfig ().getLatency () == null ? 0 : job .getAnalysisConfig ().getLatency ().millis ();
39
39
maxSize = Math .max ((int ) (Intervals .alignToCeil (latencyMs , bucketSpanMs ) / bucketSpanMs ), MIN_BUCKETS );
40
40
buckets = new long [maxSize ];
41
41
this .bucketFlushListener = bucketFlushListener ;
42
42
}
43
43
44
- public void addRecord (long recordTimestampMs ) {
44
+ void addRecord (long recordTimestampMs ) {
45
45
long bucketStartMs = Intervals .alignToFloor (recordTimestampMs , bucketSpanMs );
46
46
47
47
// Initialize earliest/latest times
@@ -103,7 +103,7 @@ private long getTimestampMs(int bucketIndex) {
103
103
return latestBucketStartMs - offsetToLatest * bucketSpanMs ;
104
104
}
105
105
106
- public void flush () {
106
+ void flush () {
107
107
if (latestBucketStartMs < 0 ) {
108
108
return ;
109
109
}
@@ -115,7 +115,7 @@ public void flush() {
115
115
}
116
116
}
117
117
118
- public double averageBucketCount () {
118
+ double averageBucketCount () {
119
119
return (double ) movingBucketCount / size ();
120
120
}
121
121
@@ -126,7 +126,7 @@ private int size() {
126
126
return (int ) ((latestBucketStartMs - earliestBucketStartMs ) / bucketSpanMs ) + 1 ;
127
127
}
128
128
129
- public interface BucketFlushListener {
129
+ interface BucketFlushListener {
130
130
void onBucketFlush (long bucketStartMs , long bucketCounts );
131
131
}
132
132
}
0 commit comments