Skip to content

Commit

Permalink
Can't keep track anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
JarcauCristian committed Dec 31, 2023
1 parent 6ac5609 commit bcdd768
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions helper_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ func getTotalBytes(alias []string, token string, fileSize float64) (float64, err
startIndex := strings.Index(stringBody, "minio_cluster_capacity_raw_free_bytes{server=\"127.0.0.1:9000\"}")
pattern := "[^0-9+e\\-\\.$]"

fmt.Printf("Start index: %d\nstringBody: %s\n", startIndex, stringBody[startIndex+63:startIndex+63+16])

re := regexp.MustCompile(pattern)
processedInput := re.ReplaceAllString(stringBody[startIndex+63:startIndex+63+16], " ")
processedInput = strings.Replace(processedInput, " ", "", -1)
Expand Down
4 changes: 2 additions & 2 deletions instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,12 @@ func (minioInstance *MinIO) uploadFile(reader io.Reader, tags map[string]string,

if len(spaces) == minioInstance.currentIndex-1 {
for k, v := range spaces[minioInstance.robinIndex] {
// First Case it selects as the target site the site at the current robinIndex if value is greater then 0
if v > 0 {
fmt.Println("First case")
targetSite = k
minioInstance.robinIndex++
} else {
fmt.Println("Second case")
// Second Case goes through all the remaining instances if for the current instance gets a negative value for the size
for i := minioInstance.robinIndex; i < len(spaces); i++ {
leftSpace := false
for k, v := range spaces[i] {
Expand Down

0 comments on commit bcdd768

Please sign in to comment.