Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for AddObservation (0.14 sec)

  1. pkg/test/loadbalancersim/mesh/node.go

    	// Get the current queue length.
    	qLen := n.q.Len()
    	qLatency := n.calcQLatency(qLen)
    
    	// Add the observations
    	tnow := time.Now()
    	n.qLength.AddObservation(float64(qLen), tnow)
    	n.qLatency.AddObservation(qLatency.Seconds(), tnow)
    
    	return n.serviceTime + qLatency
    }
    
    func (n *Node) calcQLatency(qlen int) time.Duration {
    	if !n.qLatencyEnabled {
    		return 0
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  2. pkg/test/loadbalancersim/network/helper.go

    	start := time.Now()
    	c.total.Inc()
    	c.active.Inc()
    
    	wrappedDone := func() {
    		// Calculate the latency for this request.
    		latency := time.Since(start)
    
    		// Add the latency observation.
    		c.hist.AddObservation(latency.Seconds(), time.Now())
    
    		c.active.Dec()
    
    		// Invoke the caller's handler.
    		onDone()
    	}
    
    	request(wrappedDone)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  3. pkg/test/loadbalancersim/timeseries/instance.go

    //  limitations under the License.
    
    package timeseries
    
    import (
    	"sync"
    	"time"
    )
    
    type Instance struct {
    	data  Data
    	times times
    	mutex sync.Mutex
    }
    
    func (ts *Instance) AddObservation(val float64, t time.Time) {
    	ts.mutex.Lock()
    	defer ts.mutex.Unlock()
    	ts.data = append(ts.data, val)
    	ts.times = append(ts.times, t)
    }
    
    func (ts *Instance) AddAll(o *Instance) {
    	ts.mutex.Lock()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 03 18:19:25 UTC 2022
    - 1.8K bytes
    - Viewed (0)
Back to top