Documentation ¶
Index ¶
- func GetHistogramDifference(earlier, later metrics.Float64Histogram) metrics.Float64Histogram
- type CounterMatrix
- type Dagor
- func (d *Dagor) CalculateAdmissionLevel(foverload bool) (int, int)
- func (d *Dagor) DecrementN()
- func (d *Dagor) DecrementNadm()
- func (d *Dagor) IncrementN()
- func (d *Dagor) IncrementNadm()
- func (d *Dagor) ReadN() int64
- func (d *Dagor) ReadNadm() int64
- func (d *Dagor) ResetHistogram()
- func (d *Dagor) UnaryInterceptorClient(ctx context.Context, method string, req interface{}, reply interface{}, ...) error
- func (d *Dagor) UnaryInterceptorServer(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func (d *Dagor) UpdateAdmissionLevel()
- func (d *Dagor) UpdateHistogram(admitted bool, B, U int)
- func (d *Dagor) UpdateN(newN int64)
- func (d *Dagor) UpdateNadm(newN int64)
- type DagorParam
- type ThresholdTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHistogramDifference ¶
func GetHistogramDifference(earlier, later metrics.Float64Histogram) metrics.Float64Histogram
To extract the difference between two Float64Histogram distributions, and return a new Float64Histogram you can subtract the corresponding bucket counts of the two histograms. If the earlier histogram is from an empty pointer, return the later histogram Ensure the two histograms have the same number of buckets
Types ¶
type CounterMatrix ¶
type CounterMatrix struct {
Counters [][]*int64
}
CounterMatrix holds a 2D slice of atomic counters
func NewCounterMatrix ¶
func NewCounterMatrix(bMax, uMax int) *CounterMatrix
NewCounterMatrix initializes a CounterMatrix with the given dimensions
func (*CounterMatrix) Get ¶
func (m *CounterMatrix) Get(B, U int) int64
Get safely retrieves the current value of the counter at the given B and U indices
func (*CounterMatrix) Increment ¶
func (m *CounterMatrix) Increment(B, U int)
Increment safely increments the counter at the given B and U indices
func (*CounterMatrix) Reset ¶
func (m *CounterMatrix) Reset()
Reset sets all counters in the matrix to zero
type Dagor ¶
type Dagor struct { Umax int Bmax int C sync.Map N int64 // Use int64 to be compatible with atomic operations Nadm int64 // Use int64 to be compatible with atomic operations UseSyncMap bool CM *CounterMatrix // contains filtered or unexported fields }
Dagor is the DAGOR network.
func NewDagorNode ¶
func NewDagorNode(params DagorParam) *Dagor
NewDagorNode creates a new DAGOR node without a UUID.
func (*Dagor) CalculateAdmissionLevel ¶
CalculateAdmissionLevel adjusts the B and U based on the overload flag
func (*Dagor) DecrementN ¶
func (d *Dagor) DecrementN()
func (*Dagor) DecrementNadm ¶
func (d *Dagor) DecrementNadm()
func (*Dagor) IncrementN ¶
func (d *Dagor) IncrementN()
func (*Dagor) IncrementNadm ¶
func (d *Dagor) IncrementNadm()
func (*Dagor) ResetHistogram ¶
func (d *Dagor) ResetHistogram()
func (*Dagor) UnaryInterceptorClient ¶
func (d *Dagor) UnaryInterceptorClient(ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
func (*Dagor) UnaryInterceptorServer ¶
func (d *Dagor) UnaryInterceptorServer(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
func (*Dagor) UpdateAdmissionLevel ¶
func (d *Dagor) UpdateAdmissionLevel()
overloadDetection is a function that detects overload and updates the threshold