-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add encoder queueing stats for autoscaling (#910)
- Loading branch information
Showing
4 changed files
with
86 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package common | ||
|
||
// BlobSizeBucket maps the blob size into a bucket that's defined according to | ||
// the power of 2. | ||
func BlobSizeBucket(blobSize int) string { | ||
switch { | ||
case blobSize <= 1*1024: | ||
return "1KiB" | ||
case blobSize <= 2*1024: | ||
return "2KiB" | ||
case blobSize <= 4*1024: | ||
return "4KiB" | ||
case blobSize <= 8*1024: | ||
return "8KiB" | ||
case blobSize <= 16*1024: | ||
return "16KiB" | ||
case blobSize <= 32*1024: | ||
return "32KiB" | ||
case blobSize <= 64*1024: | ||
return "64KiB" | ||
case blobSize <= 128*1024: | ||
return "128KiB" | ||
case blobSize <= 256*1024: | ||
return "256KiB" | ||
case blobSize <= 512*1024: | ||
return "512KiB" | ||
case blobSize <= 1024*1024: | ||
return "1MiB" | ||
case blobSize <= 2*1024*1024: | ||
return "2MiB" | ||
case blobSize <= 4*1024*1024: | ||
return "4MiB" | ||
case blobSize <= 8*1024*1024: | ||
return "8MiB" | ||
case blobSize <= 16*1024*1024: | ||
return "16MiB" | ||
case blobSize <= 32*1024*1024: | ||
return "32MiB" | ||
default: | ||
return "invalid" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters