Skip to content

Commit

Permalink
Adding object suffix prefix configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-prince committed Sep 8, 2024
1 parent 5a74751 commit e0a93c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ var (

// ObjectNamePrefix<worker_id>ObjectNameSuffix is the object name format.
// Here, worker id goes from <0 to NumberOfWorker>.
ObjectNamePrefix = "princer_100M_files/file_"
ObjectNameSuffix = ""
ObjectNamePrefix = flag.String("object-prefix", "princer_100M_files/file_", "Object prefix")
ObjectNameSuffix = flag.String("object-suffix", "", "Object suffix")

tracerName = "princer-storage-benchmark"
enableTracing = flag.Bool("enable-tracing", false, "Enable tracing with Cloud Trace export")
Expand Down Expand Up @@ -140,7 +140,7 @@ func CreateGrpcClient(ctx context.Context) (client *storage.Client, err error) {

func ReadObject(ctx context.Context, workerId int, bucketHandle *storage.BucketHandle) (err error) {

objectName := ObjectNamePrefix + strconv.Itoa(workerId) + ObjectNameSuffix
objectName := *ObjectNamePrefix + strconv.Itoa(workerId) + *ObjectNameSuffix

for i := 0; i < *NumOfReadCallPerWorker; i++ {
var span trace.Span
Expand Down Expand Up @@ -231,7 +231,7 @@ func main() {
Multiplier: RetryMultiplier,
}),
storage.WithPolicy(storage.RetryAlways),
storage.WithReadDynamicTimeout(0.99, 15, 50*time.Millisecond, 50*time.Millisecond, 1*time.Minute),
//storage.WithReadDynamicTimeout(0.99, 15, 50*time.Millisecond, 50*time.Millisecond, 1*time.Minute),
//storage.WithMinReadThroughput(1024, 1 * time.Second),
)

Expand All @@ -255,7 +255,7 @@ func main() {
eG.Go(func() error {
err = ReadObject(ctx, idx, bucketHandle)
if err != nil {
err = fmt.Errorf("while reading object %v: %w", ObjectNamePrefix+strconv.Itoa(idx), err)
err = fmt.Errorf("while reading object %v: %w", *ObjectNamePrefix+strconv.Itoa(idx), err)
return err
}
return err
Expand Down
Binary file modified v0
Binary file not shown.

0 comments on commit e0a93c1

Please sign in to comment.