Class RateLimiter.SimpleRateLimiter
Simple class to rate limit IO.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public class SimpleRateLimiter : RateLimiter
Constructors
| Improve this Doc View SourceSimpleRateLimiter(Double)
mbPerSec
is the MB/sec max IO rate
Declaration
public SimpleRateLimiter(double mbPerSec)
Parameters
Type | Name | Description |
---|---|---|
System.Double | mbPerSec |
Properties
| Improve this Doc View SourceMbPerSec
The current mb per second rate limit.
Declaration
public override double MbPerSec { get; }
Property Value
Type | Description |
---|---|
System.Double |
Overrides
Methods
| Improve this Doc View SourcePause(Int64)
Pauses, if necessary, to keep the instantaneous IO rate at or below the target. NOTE: multiple threads may safely use this, however the implementation is not perfectly thread safe but likely in practice this is harmless (just means in some rare cases the rate might exceed the target). It's best to call this with a biggish count, not one byte at a time.
Declaration
public override long Pause(long bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | bytes |
Returns
Type | Description |
---|---|
System.Int64 | the pause time in nano seconds |
Overrides
| Improve this Doc View SourceSetMbPerSec(Double)
Sets an updated mb per second rate limit.
Declaration
public override void SetMbPerSec(double mbPerSec)
Parameters
Type | Name | Description |
---|---|---|
System.Double | mbPerSec |