Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for updateMeasurement (0.18 sec)

  1. internal/bucket/bandwidth/reader.go

    		tokens = need
    	}
    
    	err = r.throttle.WaitN(r.ctx, tokens)
    	if err != nil {
    		return
    	}
    
    	n, err = r.r.Read(buf[:need])
    	if err != nil {
    		r.lastErr = err
    		return
    	}
    	r.m.updateMeasurement(r.opts.BucketOptions, uint64(tokens))
    	return
    }
    
    // NewMonitoredReader returns reference to a monitored reader that throttles reads to configured bandwidth for the
    // bucket.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Sep 06 03:21:59 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. internal/bucket/bandwidth/monitor.go

    		bucketMovingAvgTicker: time.NewTicker(2 * time.Second),
    		ctx:                   ctx,
    		NodeCount:             numNodes,
    	}
    	go m.trackEWMA()
    	return m
    }
    
    func (m *Monitor) updateMeasurement(opts BucketOptions, bytes uint64) {
    	m.mlock.Lock()
    	defer m.mlock.Unlock()
    
    	tm, ok := m.bucketsMeasurement[opts]
    	if !ok {
    		tm = &bucketMeasurement{}
    	}
    	tm.incrementBytes(bytes)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 6K bytes
    - Viewed (0)
Back to top