You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: store_gossip.go
    path of file: ./repos/cockroach/pkg/kv/kvserver
    
    the code of the file until where you have to start completion: // Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by 
    
func (s *StoreGossip) shouldGossipOnCapacityDelta() (should bool, reason string) {
	// If there is an ongoing gossip attempt, then there is no need to regossip
	// immediately as we will already be gossiping an up to date (cached) capacity.
	if s.gossipOngoing.Get() {
		return
	}

	gossipWhenCapacityDeltaExceedsFraction := defaultGossipWhenCapacityDeltaExceedsFraction
	if overrideCapacityDeltaFraction := s.knobs.OverrideGossipWhenCapacityDeltaExceedsFraction; overrideCapacityDeltaFraction > 0 {
		gossipWhenCapacityDeltaExceedsFraction = overrideCapacityDeltaFraction
	}

	s.cachedCapacity.Lock()
	updateForQPS, deltaQPS := deltaExceedsThreshold(
		s.cachedCapacity.lastGossiped.QueriesPerSecond, s.cachedCapacity.cached.QueriesPerSecond,
		gossipMinAbsoluteDelta, gossipWhenLoadDeltaExceedsFraction)
	updateForWPS, deltaWPS := deltaExceedsThreshold(
		s.cachedCapacity.lastGossiped.WritesPerSecond, s.cachedCapacity.cached.WritesPerSecond,
		gossipMinAbsoluteDelta, gossipWhenLoadDeltaExceedsFraction)
	updateForRangeCount, deltaRangeCount := deltaExceedsThreshold(
		float64(s.cachedCapacity.lastGossiped.RangeCount), float64(s.cachedCapacity.cached.RangeCount),
		GossipWhenRangeCountDeltaExceeds, gossipWhenCapacityDeltaExceedsFraction)
	updateForLeaseCount, deltaLeaseCount := deltaExceedsThreshold(
		float64(s.cachedCapacity.lastGossiped.LeaseCount), float64(s.cachedCapacity.cached.LeaseCount),
		gossipWhenLeaseCountDeltaExceeds, gossipWhenCapacityDeltaExceedsFraction)
	s.cachedCapacity.Unlock()

	if s.knobs.DisableLeaseCapacityGossip {
		updateForLeaseCount = false
	}

	if updateForQPS {
		reason += fmt.Sprintf("queries-per-second(%.1f) ", deltaQPS)
	}
	if updateForWPS {
		reason += fmt.Sprintf("writes-per-second(%.1f) ", deltaWPS)
	}
	if updateForRangeCount {
		reason += fmt.Sprintf("range-count(%.1f) ", deltaRangeCount)
	}
	if updateForLeaseCount {
		reason += fmt.Sprintf("lease-count(%.1f) ", deltaLeaseCount)
	}
	if reason != "" {
		should = true
		reason += "change"
	}
	return should, reason
}