INNER CODE UNIT · Go

upscale

brexhq/substation · cmd/aws/lambda/autoscale/main.go:321

func upscale(shards float64) int32 {
	switch {
	case shards < 5:
		return int32(math.Floor(shards * 2))
	case shards < 13:
		return int32(math.Floor(shards * 1.75))
	case shards < 33:
		return int32(math.Floor(shards * 1.5))
	default:
		return int32(math.Floor(shards * 1.25))
	}
}

func listShards(ctx context.Context, stream string) (int32, error) {
	var shards int32

	input := kinesis.ListShardsInput{
		StreamName: aws.String(stream),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…