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

Enhance latency map creation #1262

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/cleanDB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo
echo ==========================================================
echo "[Info]"
echo ==========================================================
echo "This script will ${LGREEN}remove all MetaDate in Local DataBases.${NC}"
echo -e "This script will ${LGREEN}remove all MetaDate in Local DataBases.${NC}"
echo "(MetaData from both CB-Tumblebug and CB-Spider container)"
echo
echo -e "Will remove following directories and files"
Expand Down
2 changes: 1 addition & 1 deletion scripts/runSpider.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

CONTAINER_NAME_READ="CB-Spider"
CONTAINER_VERSION="0.6.13"
CONTAINER_VERSION="0.6.14"
CONTAINER_PORT="-p 1024:1024 -p 2048:2048"
CONTAINER_DATA_PATH="/root/go/src/github.com/cloud-barista/cb-spider/meta_db"

Expand Down
20 changes: 16 additions & 4 deletions src/core/mcis/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func RunAllBenchmarks(nsId string, mcisId string, host string) (*BenchmarkInfoAr

content := BenchmarkInfoArray{}

allBenchCmd := []string{"cpus", "cpum", "memR", "memW", "fioR", "fioW", "dbR", "dbW", "rtt"}
allBenchCmd := []string{"cpus", "cpum", "memR", "memW", "fioR", "fioW", "dbR", "dbW"}

resultMap := make(map[string]SpecBenchmarkInfo)

Expand Down Expand Up @@ -297,13 +297,15 @@ func RunAllBenchmarks(nsId string, mcisId string, host string) (*BenchmarkInfoAr
csvWriter.Flush()
}

const empty = ""

const mrttArrayXMax = 300
const mrttArrayYMax = 300
mrttArray := make([][]string, mrttArrayXMax)
for i := 0; i < mrttArrayXMax; i++ {
mrttArray[i] = make([]string, mrttArrayYMax)
for j := 0; j < mrttArrayYMax; j++ {
mrttArray[i][j] = ""
mrttArray[i][j] = empty
}
}

Expand Down Expand Up @@ -347,7 +349,7 @@ func RunAllBenchmarks(nsId string, mcisId string, host string) (*BenchmarkInfoAr
if refIndex == 0 {
continue
}
if refVal == "" {
if refVal == empty {
break
}
orgIndex := rttIndexMapX[refVal]
Expand All @@ -366,7 +368,7 @@ func RunAllBenchmarks(nsId string, mcisId string, host string) (*BenchmarkInfoAr
// change index name from specId to regionName
for i := 1; i < len(mrttArray[0]); i++ {
targetSpecId := mrttArray[0][i]
if targetSpecId == "" {
if targetSpecId == empty {
break
}
tempInterface, err := mcir.GetResource(common.SystemCommonNs, common.StrSpec, targetSpecId)
Expand All @@ -378,6 +380,16 @@ func RunAllBenchmarks(nsId string, mcisId string, host string) (*BenchmarkInfoAr
}
}

// Fill empty with transpose matix
for i := 1; i < len(mrttArray[0]); i++ {
firstValue := mrttArray[i][1]
if firstValue == empty {
for j := 1; j < len(mrttArray[0]); j++ {
mrttArray[i][j] = mrttArray[j][i]
}
}
}

file2, err := os.OpenFile("cloudlatencymap.csv", os.O_CREATE|os.O_WRONLY, 0777)
defer file2.Close()
csvWriter2 := csv.NewWriter(file2)
Expand Down
3 changes: 3 additions & 0 deletions src/core/mcis/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,9 @@ func CreateSystemMcisDynamic(option string) (*TbMcisInfo, error) {

vmReq.Label = vmReq.CommonSpec
vmReq.Name = vmReq.CommonSpec

vmReq.RootDiskType = specList[0].RootDiskType
vmReq.RootDiskSize = specList[0].RootDiskSize
req.Vm = append(req.Vm, *vmReq)
}
}
Expand Down