public sealed class BufferOptions
Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class BufferOptions.
Options that define a buffer.
Namespace
GoogleCloudGoogle.Cloud.DiagnosticsCommonAssembly
Google.Cloud.Diagnostics.Common.dll
Properties
BufferSizeBytes
public int BufferSizeBytes { get; }
The size of the buffer in bytes, only used for Sized
Property Value | |
---|---|
Type | Description |
int |
BufferType
public BufferType BufferType { get; }
The type of buffer to be used.
Property Value | |
---|---|
Type | Description |
BufferType |
BufferWaitTime
public TimeSpan BufferWaitTime { get; }
The time to wait before the buffer is flushed, only used for Timed
Property Value | |
---|---|
Type | Description |
TimeSpan |
TimerExceptionHandler
public Action<Exception> TimerExceptionHandler { get; }
An action that will be called whenever an exception is thrown during a timed flush of the buffer. May be null. Only used for Timed.
Property Value | |
---|---|
Type | Description |
ActionException |
Throwing an exception within the timer thread risks inmediately crashing the applicaiton, so we never do that, even if ExceptionHandling has been set to Propagate because propagating exceptions is different than crashing an application. Instead, client code can specify a value for this action, that will be called when an exception is thrown within the timer thread. Client code may decide what to do in such cases.
Methods
NoBuffer()
public static BufferOptions NoBuffer()
Create BufferOptions for None
Returns | |
---|---|
Type | Description |
BufferOptions |
SizedBuffer(int)
public static BufferOptions SizedBuffer(int bufferSizeBytes = 65536)
Create BufferOptions for Sized
Parameter | |
---|---|
Name | Description |
bufferSizeBytes | int Optional, The buffer size in bytes. |
Returns | |
---|---|
Type | Description |
BufferOptions |
TimedBuffer(TimeSpan?)
public static BufferOptions TimedBuffer(TimeSpan? bufferWaitTime = null)
Create BufferOptions for Timed
Parameter | |
---|---|
Name | Description |
bufferWaitTime | TimeSpan Optional, The minimum amount of time between flushes. |
Returns | |
---|---|
Type | Description |
BufferOptions |
WithTimerExceptionHandler(Action<Exception>)
public BufferOptions WithTimerExceptionHandler(Action<Exception> handler)
Creates a new BufferOptions instance which is identical to this one but with the given timer exception handler.
Parameter | |
---|---|
Name | Description |
handler | ActionException |
Returns | |
---|---|
Type | Description |
BufferOptions |