Documentation ¶
Index ¶
- type BucketBandwidthReport
- type Details
- type Monitor
- func (m *Monitor) DeleteBucket(bucket string)
- func (m *Monitor) DeleteBucketThrottle(bucket, arn string)
- func (m *Monitor) GetReport(selectBucket SelectionFunction) *BucketBandwidthReport
- func (m *Monitor) IsThrottled(bucket, arn string) bool
- func (m *Monitor) SetBandwidthLimit(bucket, arn string, limit int64)
- type MonitorReaderOptions
- type MonitoredReader
- type SelectionFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketBandwidthReport ¶
type BucketBandwidthReport struct {
BucketStats map[string]map[string]Details `json:"bucketStats,omitempty"`
}
BucketBandwidthReport captures the details for all buckets.
type Details ¶
type Details struct { LimitInBytesPerSecond int64 `json:"limitInBits"` CurrentBandwidthInBytesPerSecond float64 `json:"currentBandwidth"` }
Details for the measured bandwidth
type Monitor ¶
type Monitor struct { NodeCount uint64 // contains filtered or unexported fields }
Monitor holds the state of the global bucket monitor
func NewMonitor ¶
NewMonitor returns a monitor with defaults.
func (*Monitor) DeleteBucket ¶
DeleteBucket deletes monitoring the 'bucket'
func (*Monitor) DeleteBucketThrottle ¶
DeleteBucketThrottle deletes monitoring for a bucket's target
func (*Monitor) GetReport ¶
func (m *Monitor) GetReport(selectBucket SelectionFunction) *BucketBandwidthReport
GetReport gets the report for all bucket bandwidth details.
func (*Monitor) IsThrottled ¶
IsThrottled returns true if a bucket has bandwidth throttling enabled.
func (*Monitor) SetBandwidthLimit ¶
SetBandwidthLimit sets the bandwidth limit for a bucket
type MonitorReaderOptions ¶
MonitorReaderOptions provides configurable options for monitor reader implementation.
type MonitoredReader ¶
type MonitoredReader struct {
// contains filtered or unexported fields
}
MonitoredReader represents a throttled reader subject to bandwidth monitoring
func NewMonitoredReader ¶
func NewMonitoredReader(ctx context.Context, m *Monitor, r io.Reader, opts *MonitorReaderOptions) *MonitoredReader
NewMonitoredReader returns reference to a monitored reader that throttles reads to configured bandwidth for the bucket.
type SelectionFunction ¶
SelectionFunction for buckets
func SelectBuckets ¶
func SelectBuckets(buckets ...string) SelectionFunction
SelectBuckets will select all the buckets passed in.