Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Mynij-unit-tests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
Mynij-unit-tests
Commits
ac2c2b3a
Commit
ac2c2b3a
authored
Dec 09, 2019
by
Alexandra Rogova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
0dbf42fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
34 deletions
+51
-34
add_random_csv.js
add_random_csv.js
+4
-3
add_random_csv_attachments_bench.js
add_random_csv_attachments_bench.js
+47
-31
No files found.
add_random_csv.js
View file @
ac2c2b3a
...
@@ -57,10 +57,10 @@ function init_server (){
...
@@ -57,10 +57,10 @@ function init_server (){
console
.
log
(
msg
);
console
.
log
(
msg
);
var
ramAfter
=
(
os
.
totalmem
()
-
os
.
freemem
())
/
1024
/
1024
;
var
ramAfter
=
(
os
.
totalmem
()
-
os
.
freemem
())
/
1024
/
1024
;
var
ramUsed
=
ramAfter
-
ramBefore
;
var
ramUsed
=
ramAfter
-
ramBefore
;
console
.
log
(
"
Ram used :
"
+
ramUsed
+
"
MB
"
);
//
console.log("Ram used : " + ramUsed + " MB");
si
.
mem
(
function
(
data
){
si
.
mem
(
function
(
data
){
//
process.send(ramUsed + "," + -(data.used / 1024 / 1024 - memBefore));
process
.
send
(
ramUsed
+
"
,
"
+
-
(
data
.
used
/
1024
/
1024
-
memBefore
));
console
.
log
(
"
Memory used :
"
+
(
data
.
used
/
1024
/
1024
-
memBefore
)
+
"
MB
"
);
//
console.log("Memory used : " + (data.used / 1024 / 1024 - memBefore) + " MB");
});
});
browser
.
close
();
browser
.
close
();
});
});
...
@@ -81,6 +81,7 @@ function gen_random_content (){
...
@@ -81,6 +81,7 @@ function gen_random_content (){
}
}
(
async
()
=>
{
(
async
()
=>
{
console
.
log
(
args
.
p
);
init_server
();
init_server
();
var
file_path
=
gen_random_content
();
var
file_path
=
gen_random_content
();
browser
=
await
puppeteer
.
launch
();
browser
=
await
puppeteer
.
launch
();
...
...
add_random_csv_attachments_bench.js
View file @
ac2c2b3a
...
@@ -30,7 +30,7 @@ function runScriptSync(list, callback) {
...
@@ -30,7 +30,7 @@ function runScriptSync(list, callback) {
});
});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
writeResult
(
to_run
.
amout
,
"
Timeout error
"
);
process
.
kill
();
process
.
kill
();
return
;
return
;
},
7200000
);
//2 hours
},
7200000
);
//2 hours
...
@@ -39,11 +39,27 @@ function runScriptSync(list, callback) {
...
@@ -39,11 +39,27 @@ function runScriptSync(list, callback) {
fs
.
truncateSync
(
"
./results/add_random_csv_attachment.csv
"
);
fs
.
truncateSync
(
"
./results/add_random_csv_attachment.csv
"
);
stream
.
write
(
"
items,ramUsed,memUsed
\n
"
);
stream
.
write
(
"
items,ramUsed,memUsed
\n
"
);
var
to_run
=
[{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
100000
,
"
-s
"
,
"
attachment
"
],
amount
:
100000
},
var
to_run
=
[];
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
50000
,
"
-s
"
,
"
attachment
"
],
amount
:
50000
},
for
(
var
i
=
1000000
;
i
>
0
;
i
-=
1000
){
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
10000
,
"
-s
"
,
"
attachment
"
],
amount
:
10000
},
to_run
.
push
({
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
i
,
"
-s
"
,
"
attachment
"
],
amount
:
i
});
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
5000
,
"
-s
"
,
"
attachment
"
],
amount
:
5000
},
}
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
1000
,
"
-s
"
,
"
attachment
"
],
amount
:
1000
},
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
100
,
"
-s
"
,
"
attachment
"
],
amount
:
100
}];
// var to_run = [{scriptPath : './add_random_csv.js', args : ["-p", 100000, "-s", "attachment"], amount : 100000},
// {scriptPath : './add_random_csv.js', args : ["-p", 425000, "-s", "attachment"], amount : 425000},
// {scriptPath : './add_random_csv.js', args : ["-p", 400000, "-s", "attachment"], amount : 400000},
// {scriptPath : './add_random_csv.js', args : ["-p", 350000, "-s", "attachment"], amount : 350000},
// {scriptPath : './add_random_csv.js', args : ["-p", 325000, "-s", "attachment"], amount : 325000},
// {scriptPath : './add_random_csv.js', args : ["-p", 300000, "-s", "attachment"], amount : 300000},
// {scriptPath : './add_random_csv.js', args : ["-p", 250000, "-s", "attachment"], amount : 250000},
// {scriptPath : './add_random_csv.js', args : ["-p", 225000, "-s", "attachment"], amount : 225000},
// {scriptPath : './add_random_csv.js', args : ["-p", 200000, "-s", "attachment"], amount : 200000},
// {scriptPath : './add_random_csv.js', args : ["-p", 150000, "-s", "attachment"], amount : 150000},
// {scriptPath : './add_random_csv.js', args : ["-p", 125000, "-s", "attachment"], amount : 125000},
// {scriptPath : './add_random_csv.js', args : ["-p", 100000, "-s", "attachment"], amount : 100000},
// {scriptPath : './add_random_csv.js', args : ["-p", 50000, "-s", "attachment"], amount : 50000},
// {scriptPath : './add_random_csv.js', args : ["-p", 10000, "-s", "attachment"], amount : 10000},
// {scriptPath : './add_random_csv.js', args : ["-p", 5000, "-s", "attachment"], amount : 5000},
// {scriptPath : './add_random_csv.js', args : ["-p", 1000, "-s", "attachment"], amount : 1000},
// {scriptPath : './add_random_csv.js', args : ["-p", 100, "-s", "attachment"], amount : 100}];
runScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
runScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment