mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
Use humanize constants for KiB, MiB and GiB units. (#3322)
This commit is contained in:
@@ -21,6 +21,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
// Wrapper for calling NewMultipartUpload tests for both XL multiple disks and single node setup.
|
||||
@@ -1782,7 +1784,7 @@ func testObjectCompleteMultipartUpload(obj ObjectLayer, instanceType string, t T
|
||||
uploadIDs = append(uploadIDs, uploadID)
|
||||
// Parts with size greater than 5 MB.
|
||||
// Generating a 6MB byte array.
|
||||
validPart := bytes.Repeat([]byte("abcdef"), 1024*1024)
|
||||
validPart := bytes.Repeat([]byte("abcdef"), 1*humanize.MiByte)
|
||||
validPartMD5 := getMD5Hash(validPart)
|
||||
// Create multipart parts.
|
||||
// Need parts to be uploaded before CompleteMultiPartUpload can be called tested.
|
||||
@@ -1941,41 +1943,41 @@ func testObjectCompleteMultipartUpload(obj ObjectLayer, instanceType string, t T
|
||||
|
||||
// BenchmarkPutObjectPart5MbFS - Benchmark FS.PutObjectPart() for object size of 5MB.
|
||||
func BenchmarkPutObjectPart5MbFS(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "FS", 5*1024*1024)
|
||||
benchmarkPutObjectPart(b, "FS", 5*humanize.MiByte)
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart5MbXL - Benchmark XL.PutObjectPart() for object size of 5MB.
|
||||
func BenchmarkPutObjectPart5MbXL(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "XL", 5*1024*1024)
|
||||
benchmarkPutObjectPart(b, "XL", 5*humanize.MiByte)
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart10MbFS - Benchmark FS.PutObjectPart() for object size of 10MB.
|
||||
func BenchmarkPutObjectPart10MbFS(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "FS", 10*1024*1024)
|
||||
benchmarkPutObjectPart(b, "FS", 10*humanize.MiByte)
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart10MbXL - Benchmark XL.PutObjectPart() for object size of 10MB.
|
||||
func BenchmarkPutObjectPart10MbXL(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "XL", 10*1024*1024)
|
||||
benchmarkPutObjectPart(b, "XL", 10*humanize.MiByte)
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart25MbFS - Benchmark FS.PutObjectPart() for object size of 25MB.
|
||||
func BenchmarkPutObjectPart25MbFS(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "FS", 25*1024*1024)
|
||||
benchmarkPutObjectPart(b, "FS", 25*humanize.MiByte)
|
||||
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart25MbXL - Benchmark XL.PutObjectPart() for object size of 25MB.
|
||||
func BenchmarkPutObjectPart25MbXL(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "XL", 25*1024*1024)
|
||||
benchmarkPutObjectPart(b, "XL", 25*humanize.MiByte)
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart50MbFS - Benchmark FS.PutObjectPart() for object size of 50MB.
|
||||
func BenchmarkPutObjectPart50MbFS(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "FS", 50*1024*1024)
|
||||
benchmarkPutObjectPart(b, "FS", 50*humanize.MiByte)
|
||||
}
|
||||
|
||||
// BenchmarkPutObjectPart50MbXL - Benchmark XL.PutObjectPart() for object size of 50MB.
|
||||
func BenchmarkPutObjectPart50MbXL(b *testing.B) {
|
||||
benchmarkPutObjectPart(b, "XL", 50*1024*1024)
|
||||
benchmarkPutObjectPart(b, "XL", 50*humanize.MiByte)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user