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

A problem encountered during using nebula-bench to test "insert vertex" statements #72

Open
jacool1999 opened this issue Jun 15, 2022 · 0 comments

Comments

@jacool1999
Copy link

jacool1999 commented Jun 15, 2022

Using nebula-bench to test “insert vertex” statement,The “InsertComment” class created in the “scenarios” folder is shown below:

class InsertComment(BaseScenario):
is_insert_scenario = True
nGQL = "INSERT VERTEX Comment (creationDate, locationIP, browserUsed, content, length) VALUES "
abstract = False
csv_path = "social_network/dynamic/comment.csv"
csv_index = [1, 2, 3, 4, 5]

The statement that is then executed is as follows (corresponding to the name and address of the graph space):

python3 run.py stress run -scenario insert.InsertComment --args='-u 3 -d 3s' -s stress_test_0518 -a 172.18.0.8:9669

The test results returned are as follows:
image

Afterwards, open the relevant js file and CSV file in the output folder to see the problem.
Part of the output_InsertComment.csv file is as follows:
image

The main error is that each time the ngql statement is constructed, two double quotes are constructed in the double quotes describing the vertex’s attributes.
Subsequently, the generated InsertComment.js file was queried,Some of the code is as follows:

export function setup() {
// config csv file
pool.configCSV("target/data/test_data/social_network/dynamic/comment.csv", "|", false)
// config output file, save every query information
pool.configOutput("output/output_InsertComment.csv")
sleep(1)
}

export default function (data) {
let ngql = 'INSERT VERTEX Comment (creationDate, locationIP, browserUsed, content, length) VALUES '
let batches = []
let batchSize = 100
// batch size 100
for (let i = 0; i < batchSize; i++) {
let d = session.getData();
let values = []
let arr = [1,2,3,4,5]
arr.forEach(function(e){
let value = '"' + d[e] + '"'
values.push(value)
})

let batch = d[0] + ":(" + values.join(",") + ")"
batches.push(batch)

}
ngql = ngql + batches.join(',')
let response = session.execute(ngql)
check(response, {
"IsSucceed": (r) => r.isSucceed() === true
});
// add trend
lantencyTrend.add(response.getLatency());
responseTrend.add(response.getResponseTime());
};

Afterwards, Try to change “ let value = '"' + d[e] + '"' “ to “ let value = “’” + d[e] + “’” “, Execute the statement:

scripts/k6 run output/InsertComment.js -u 3 -d 3s --summary-trend-stats "min,avg,med,max,p(90),p(95),p(99)" --summary-export output/result_InsertComment.json
The checks of k6's output is still 0.
image
The output_InsertComment.csv file was found to be as follows:
image
Found that only a single quote was output in the executed ngql statement, then tried successively with """ + d[e] + """, " \x22" + d[e] + "\x22" and so on, but the output csv file shows two double quotes. I would like to know what the problem is and how to solve it.

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

No branches or pull requests

1 participant