func (sl SketchSeriesList) SplitPayload(times int) ([]marshaler.Marshaler, error) {
	// Only break it down as much as possible
	if len(sl) < times {
		times = len(sl)
	}
	splitPayloads := make([]marshaler.Marshaler, times)
	batchSize := len(sl) / times
	n := 0
	for i := 0; i < times; i++ {
		var end int
		// In many cases the batchSize is not perfect
		// so the last one will be a bit bigger or smaller than the others
		if i < times-1 {
			end = n + batchSize
		} else {
			end = len(sl)
		}
		newSL := sl[n:end]
		splitPayloads[i] = newSL
		n += batchSize
	}
	return splitPayloads, nil
}
// SplitPayload breaks the payload into times number of pieces
SplitPayload breaks the payload into times number of pieces
// SplitPayload breaks the payload into times number of pieces
func (sl SketchSeriesList) SplitPayload(times int) ([]marshaler.Marshaler, error) {
	if len(sl) < times {
		times = len(sl)
	}
	splitPayloads := make([]marshaler.Marshaler, times)
	batchSize := len(sl) / times
	n := 0
	for i := 0; i < times; i++ {
		var end int
		if i < times-1 {
			end = n + batchSize
		} else {
			end = len(sl)
		}
		newSL := sl[n:end]
		splitPayloads[i] = newSL
		n += batchSize
	}
	return splitPayloads, nil
}
func ( sl SketchSeriesList ) SplitPayload ( times int ) ( [ ] marshaler . Marshaler , error ) { if len ( sl ) < times { times = len ( sl ) } splitPayloads := make ( [ ] marshaler . Marshaler , times ) batchSize := len ( sl ) / times n := 0 for i := 0 ; i < times ; i ++ { var end int if i < times - 1 { end = n + batchSize } else { end = len ( sl ) } newSL := sl [ n : end ] splitPayloads [ i ] = newSL n += batchSize } return splitPayloads , nil }
SplitPayload breaks the payload into times number of pieces
SplitPayload breaks the payload into times number of pieces
// Only break it down as much as possible // In many cases the batchSize is not perfect // so the last one will be a bit bigger or smaller than the others