Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compression ratio in s3bench.go#L136-L137 #11

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

raikrahul
Copy link

@raikrahul raikrahul commented Nov 13, 2020

We need to make some random data and sprinkle it with a const value

`
func fill_buffer(comp_percent int, size int) []byte {

	res := make([]byte, size)

	if comp_percent == 100 {
		return res
	}

	var rand_size int

	rand_size = (size * (100 - comp_percent)) / 100

	var source = rand.NewSource(time.Now().UnixNano())
	rand.New(source)
	rand.Read(res[0:rand_size])

	fmt.Println("Array:", res)

	rand.Shuffle(len(res), func(i, j int) {
		res[i], res[j] = res[j], res[i]
	})

	return res

}
`

The test for it is as follow


package main

import (
	"fmt"
	"math/rand"
	"time"
)

// fill_buffer provides a stream of compressible data
// Blanks/Zeros are added randomly amongst the random data stream
// It returns the data stream

func fill_buffer(comp_percent int, size int) []byte {

	res := make([]byte, size)

	if comp_percent == 100 {
		return res
	}

	var rand_size int

	rand_size = (size * (100 - comp_percent)) / 100

	var source = rand.NewSource(time.Now().UnixNano())
	rand.New(source)
	rand.Read(res[0:rand_size])

	fmt.Println("Array:", res)

	rand.Shuffle(len(res), func(i, j int) {
		res[i], res[j] = res[j], res[i]
	})

	return res

}
func main() {
	// fmt.Println("hello world")
	var size int

	var ratio int

	size = 4096
	ratio = 50

	resT := fill_buffer(ratio, size)
	fmt.Println(resT)
	fmt.Println("Slice:", resT)

	fmt.Println("Size was", size)

	fmt.Println("Ratio was", ratio)
}







DSurnin and others added 22 commits March 5, 2020 14:38
Add head-object request;
Add avg time;
Object size support Gb, Mb, Kb, b specifiers;
Number of reads for each file;
Ttfb - time to first byte - metrics;
do not print anything in non verbose mode
…nario

Added ability to run read/validate and write tests independently each other
added cmd param -skipWrite
added cmd param -skipRead
fix tag delete on clean up

Signed-off-by: Dmitrii Surnin <[email protected]>
EOS-9790 : S3 - S3bench: enhance checksum support, cover failover sce…
@t7ko-seagate t7ko-seagate deleted the branch igneous-systems:master March 2, 2021 14:14
@t7ko-seagate t7ko-seagate deleted the master branch March 2, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants