Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorsesan committed Nov 14, 2024
1 parent 8a7a07f commit adadd52
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public CompletableResultCode export(Collection<SpanData> spans) {
}

private boolean canExport(long spanSize) {
long currentTime = System.currentTimeMillis();
long currentTime = SystemTime.get().getCurrentTimeMillis();
if (currentTime - lastExportTime > timeWindowInMillis) {
// Reset the window
bytesExportedInWindow = 0;
Expand Down Expand Up @@ -87,26 +87,26 @@ public CompletableResultCode shutdown() {

static class Builder {
final SpanExporter delegate;
CategoryFunction categoryFunction = span -> "default";
long maxBytesPerSecond = 1024; // Default to 1 KB/s
long timeWindowInMillis = 1000; // Default to 1 second

private CategoryFunction categoryFunction = span -> "default";
private long maxBytesPerSecond = 1024; // Default to 1 KB/s
private long timeWindowInMillis = 1000; // Default to 1 second
private Builder(SpanExporter delegate) {
this.delegate = delegate;
}

Builder maxBytesPerSecond(long maxBytesPerSecond) {
this.maxBytesPerSecond = maxBytesPerSecond;
return this;
}

Builder timeWindow(Duration timeWindow) {
this.timeWindow = timeWindow;
return this;
}

BandwidthThrottlingExporter build() {
return new BandwidthThrottlingExporter(this);
}
}
}
}

0 comments on commit adadd52

Please sign in to comment.