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: replica_stats.go
    path of file: ./repos/cockroach/pkg/kv/kvserver/replicastats
    
    the code of the file until where you have to start completion: // Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package replicastats

import (
	"fmt"
	"math"
	"time"

	"github.com/cockroachdb/cockroach/pkg/roachpb"
	"g
    
func (rsr *replicaStatsRecord) split(other *replicaStatsRecord) {
	rsr.sum = rsr.sum / 2.0
	other.sum = rsr.sum

	// When the calling record's locality counts are not set, there is nothing
	// to split onto the other record's localityCounts.
	if rsr.localityCounts == nil {
		return
	}

	// Halve the calling record's locality counts, so that even if the other
	// record won't be updated, the calling record has at least halved.
	for locality, count := range *rsr.localityCounts {
		(*rsr.localityCounts)[locality] = count / 2.0
	}

	// When the other record's locality counts are not set, there is nothing to
	// split into.
	if other.localityCounts == nil {
		return
	}

	for locality := range *rsr.localityCounts {
		(*other.localityCounts)[locality] = (*rsr.localityCounts)[locality]
	}
}