Class BatchOptions
java.lang.Object
codes.grow.packages.skywalking.logging.BatchOptions
Options of a
BatchProcessor. Defaults: queue 2048 records, batches of at most 512 records
and 1 MiB (UTF-8 JSON size), flush every second, 30 s export timeout, DropPolicy.DROP_NEWEST, gzip on, 2 export retries with 200 ms base backoff.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchOptions.Builderbuilder()Returns a builder with the defaults.static BatchOptionsdefaults()Returns the defaults.Queue-full behaviour (defaultDropPolicy.DROP_NEWEST).Time budget per export including retries; also the default flush/shutdown timeout (default 30 s).Interval of the background flush (default 1 s).booleangzip()Whether exports are gzipped (default true).intMaximum UTF-8 JSON bytes per export (default 1 048 576).intMaximum records per export (default 512).intExport attempts repeated after a retryable failure (default 2).intMaximum number of queued records (default 2048).onDrop()Drop callback.onError()Export error callback.Base delay before a repeated export, doubled per attempt (default 200 ms).Returns a builder initialised with these options.toString()
-
Method Details
-
defaults
Returns the defaults.- Returns:
- default options
-
builder
Returns a builder with the defaults.- Returns:
- builder
-
toBuilder
Returns a builder initialised with these options.- Returns:
- builder copy
-
maxQueueSize
public int maxQueueSize()Maximum number of queued records (default 2048).- Returns:
- queue size
-
maxBatchSize
public int maxBatchSize()Maximum records per export (default 512).- Returns:
- batch size
-
maxBatchBytes
public int maxBatchBytes()Maximum UTF-8 JSON bytes per export (default 1 048 576). A single larger record is exported alone.- Returns:
- batch bytes
-
flushInterval
Interval of the background flush (default 1 s).- Returns:
- interval
-
exportTimeout
Time budget per export including retries; also the default flush/shutdown timeout (default 30 s).- Returns:
- timeout
-
dropPolicy
Queue-full behaviour (defaultDropPolicy.DROP_NEWEST).- Returns:
- policy
-
gzip
public boolean gzip()Whether exports are gzipped (default true).- Returns:
- gzip flag
-
maxExportRetries
public int maxExportRetries()Export attempts repeated after a retryable failure (default 2).- Returns:
- retries
-
retryBackoff
Base delay before a repeated export, doubled per attempt (default 200 ms).- Returns:
- backoff
-
onDrop
Drop callback.- Returns:
- callback (never
null; no-op by default)
-
onError
Export error callback.- Returns:
- callback (never
null; no-op by default)
-
toString
-