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
12e3e025
Commit
12e3e025
authored
Dec 09, 2019
by
Alexandra Rogova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up
parent
9475c85f
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
43 additions
and
597 deletions
+43
-597
add_csv_attachments_bench.js
add_csv_attachments_bench.js
+2
-35
add_csv_metadata_bench.js
add_csv_metadata_bench.js
+2
-35
add_random_csv_metadata_bench.js
add_random_csv_metadata_bench.js
+6
-41
download_content_bench.js
download_content_bench.js
+2
-35
download_content_random_bench.js
download_content_random_bench.js
+6
-41
download_index_bench.js
download_index_bench.js
+2
-35
download_index_random_bench.js
download_index_random_bench.js
+6
-41
export_content_bench.js
export_content_bench.js
+2
-35
export_index_bench.js
export_index_bench.js
+1
-35
import_content_bench.js
import_content_bench.js
+2
-35
import_content_bulk_bench.js
import_content_bulk_bench.js
+2
-35
import_content_uncompressed_bench.js
import_content_uncompressed_bench.js
+2
-35
import_index_bench.js
import_index_bench.js
+2
-35
import_index_uncompressed_bench.js
import_index_uncompressed_bench.js
+2
-35
rss_bench.js
rss_bench.js
+2
-54
sitemap_bench.js
sitemap_bench.js
+2
-35
No files found.
add_csv_attachments_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/add_csv_attachments.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/add_csv_attachments.csv
"
);
stream
.
write
(
"
items,ramUsed,memUsed
\n
"
);
...
...
@@ -44,4 +11,4 @@ var to_run = [{scriptPath : './add_csv.js', args : ['-f' ,"./test_files/CSV/100k
{
scriptPath
:
'
./add_csv.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/1000.csv
"
,
"
-s
"
,
"
attachment
"
],
amount
:
1000
},
{
scriptPath
:
'
./add_csv.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/100.csv
"
,
"
-s
"
,
"
attachment
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/add_csv_attachment.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
add_csv_metadata_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/add_csv_metadata.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/add_csv_metadata.csv
"
);
stream
.
write
(
"
items,ramUsed,memUsed
\n
"
);
...
...
@@ -44,4 +11,4 @@ var to_run = [{scriptPath : './add_csv.js', args : ['-f' ,"./test_files/CSV/100k
{
scriptPath
:
'
./add_csv.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/1000.csv
"
,
"
-s
"
,
"
metadata
"
],
amount
:
1000
},
{
scriptPath
:
'
./add_csv.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/100.csv
"
,
"
-s
"
,
"
metadata
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/add_csv_metadata.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
add_random_csv_metadata_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/add_random_csv_metadata.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/add_random_csv_metadata.csv
"
);
stream
.
write
(
"
items,ramUsed,memUsed
\n
"
);
var
to_run
=
[{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
100000
,
"
-s
"
,
"
metadata
"
],
amount
:
100000
},
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
50000
,
"
-s
"
,
"
metadata
"
],
amount
:
50000
},
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
10000
,
"
-s
"
,
"
metadata
"
],
amount
:
10000
},
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
5000
,
"
-s
"
,
"
metadata
"
],
amount
:
5000
},
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
1000
,
"
-s
"
,
"
metadata
"
],
amount
:
1000
},
{
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
100
,
"
-s
"
,
"
metadata
"
],
amount
:
100
}];
var
to_run
=
[];
for
(
var
i
=
1000000
;
i
>
0
;
i
-=
1000
){
to_run
.
push
({
scriptPath
:
'
./add_random_csv.js
'
,
args
:
[
"
-p
"
,
i
,
"
-s
"
,
"
metadata
"
],
amount
:
i
});
}
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/add_random_csv_metadata.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
download_content_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/content_csv_size.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/content_csv_size.csv
"
);
stream
.
write
(
"
items,uncompressed,compressed
\n
"
);
...
...
@@ -44,4 +11,4 @@ var to_run = [{scriptPath : './download_content.js', args : ['-f' ,"./test_files
{
scriptPath
:
'
./download_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/1000.csv
"
],
amount
:
1000
},
{
scriptPath
:
'
./download_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/100.csv
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/content_csv_size.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
download_content_random_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/content_random_size.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/content_random_size.csv
"
);
stream
.
write
(
"
items,uncompressed,compressed
\n
"
);
var
to_run
=
[{
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
'
-p
'
,
"
100000
"
],
amount
:
100000
},
{
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
'
-p
'
,
"
50000
"
],
amount
:
50000
},
{
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
'
-p
'
,
"
10000
"
],
amount
:
10000
},
{
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
'
-p
'
,
"
5000
"
],
amount
:
5000
},
{
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
'
-p
'
,
"
1000
"
],
amount
:
1000
},
{
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
'
-p
'
,
"
100
"
],
amount
:
100
}];
var
to_run
=
[];
for
(
var
i
=
1000000
;
i
>
0
;
i
-=
1000
){
to_run
.
push
({
scriptPath
:
'
./download_content_random.js
'
,
args
:
[
"
-p
"
,
i
],
amount
:
i
});
}
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/content_random_size.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
download_index_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/index_csv_size.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/index_csv_size.csv
"
);
stream
.
write
(
"
items,uncompressed,compressed
\n
"
);
...
...
@@ -44,4 +11,4 @@ var to_run = [{scriptPath : './download_index.js', args : ['-f' ,"./test_files/C
{
scriptPath
:
'
./download_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/1000.csv
"
],
amount
:
1000
},
{
scriptPath
:
'
./download_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CSV/100.csv
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/index_csv_size.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
download_index_random_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/index_random_size.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/index_random_size.csv
"
);
stream
.
write
(
"
items,uncompressed,compressed
\n
"
);
var
to_run
=
[{
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
'
-p
'
,
"
100000
"
],
amount
:
100000
},
{
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
'
-p
'
,
"
50000
"
],
amount
:
50000
},
{
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
'
-p
'
,
"
10000
"
],
amount
:
10000
},
{
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
'
-p
'
,
"
5000
"
],
amount
:
5000
},
{
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
'
-p
'
,
"
1000
"
],
amount
:
1000
},
{
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
'
-p
'
,
"
100
"
],
amount
:
100
}];
var
to_run
=
[];
for
(
var
i
=
1000000
;
i
>
0
;
i
-=
1000
){
to_run
.
push
({
scriptPath
:
'
./download_index_random.js
'
,
args
:
[
"
-p
"
,
i
],
amount
:
i
});
}
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/index_random_size.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
export_content_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/export_content.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/export_content.csv
"
);
stream
.
write
(
"
items,zip,json
\n
"
);
...
...
@@ -42,4 +9,4 @@ var to_run = [{scriptPath : './export_content.js', args : ['-f' ,"./test_files/C
{
scriptPath
:
'
./export_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content1000.zip
"
],
amount
:
1000
},
{
scriptPath
:
'
./export_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content100.zip
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/export_content.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
export_index_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
);
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/export_index.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
info
){
stream
.
write
(
items
+
"
,
"
+
info
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/export_index.csv
"
);
stream
.
write
(
"
items,zip,json
\n
"
);
...
...
@@ -44,4 +10,4 @@ var to_run = [{scriptPath : './export_index.js', args : ['-f' ,"./test_files/IND
{
scriptPath
:
'
./export_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/INDEX/index1000.json
"
],
amount
:
1000
},
{
scriptPath
:
'
./export_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/INDEX/index100.json
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/export_index.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
import_content_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_content.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/import_content.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -42,4 +9,4 @@ var to_run = [{scriptPath : './import_content.js', args : ['-f' ,"./test_files/C
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content1000.zip
"
],
amount
:
1000
},
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content100.zip
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/import_content.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
import_content_bulk_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_content_bulk.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/import_content_bulk.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -42,4 +9,4 @@ var to_run = [{scriptPath : './import_content.js', args : ['-f' ,"./test_files/C
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content1000.zip
"
,
'
-b
'
],
amount
:
1000
},
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content100.zip
"
,
'
-b
'
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/import_content_bulk.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
import_content_uncompressed_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_content_uncompressed.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/import_content_uncompressed.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -42,4 +9,4 @@ var to_run = [{scriptPath : './import_content.js', args : ['-f' ,"./test_files/C
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content1000.json
"
,
'
-u
'
],
amount
:
1000
},
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content100.json
"
,
'
-u
'
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/import_content_uncompressed.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
import_index_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_index.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/import_index.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -44,4 +11,4 @@ var to_run = [{scriptPath : './import_index.js', args : ['-f' ,"./test_files/IND
{
scriptPath
:
'
./import_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/INDEX/index1000.zip
"
],
amount
:
1000
},
{
scriptPath
:
'
./import_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/INDEX/index100.zip
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/import_index.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
import_index_uncompressed_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_index_uncompressed.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/import_index_uncompressed.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -44,4 +11,4 @@ var to_run = [{scriptPath : './import_index.js', args : ['-f' ,"./test_files/IND
{
scriptPath
:
'
./import_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/INDEX/index1000.json
"
,
'
-u
'
],
amount
:
1000
},
{
scriptPath
:
'
./import_index.js
'
,
args
:
[
'
-f
'
,
"
./test_files/INDEX/index100.json
"
,
'
-u
'
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/import_index_uncompressed.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
rss_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/rss.csv
"
,
{
flags
:
'
a
'
});
// function runScript(scriptPath, args, callback) {
// var invoked = false,
// process = childProcess.fork(scriptPath, args);
// process.on('message', function (mes){
// console.log("Message from child : " + mes);
// });
// process.on('error', function (err) {
// if (invoked) return;
// invoked = true;
// callback(err);
// });
// process.on('exit', function (code) {
// if (invoked) return;
// invoked = true;
// var err = code === 0 ? null : new Error('exit code ' + code);
// callback(err);
// });
// }
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/rss.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -63,4 +11,4 @@ var to_run = [{scriptPath : './add_rss.js', args : ['-f' ,"./test_files/RSS/rss_
{
scriptPath
:
'
./add_rss.js
'
,
args
:
[
'
-f
'
,
"
./test_files/RSS/rss_1000.xml
"
],
amount
:
1000
},
{
scriptPath
:
'
./add_rss.js
'
,
args
:
[
'
-f
'
,
"
./test_files/RSS/rss_100.xml
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/rss.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
sitemap_bench.js
View file @
12e3e025
var
childProcess
=
require
(
'
child_process
'
)
;
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/sitemap.csv
"
,
{
flags
:
'
a
'
});
function
writeResult
(
items
,
time
){
stream
.
write
(
items
+
"
,
"
+
time
+
"
\n
"
);
}
function
runScriptSync
(
list
,
callback
)
{
if
(
list
.
length
===
0
)
return
;
var
invoked
=
false
,
to_run
=
list
.
pop
();
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
console
.
log
(
to_run
.
amount
+
"
:
"
+
mes
)
writeResult
(
to_run
.
amount
,
mes
);
runScriptSync
(
list
,
callback
);
});
process
.
on
(
'
error
'
,
function
(
err
)
{
if
(
invoked
)
return
;
invoked
=
true
;
callback
(
err
);
});
process
.
on
(
'
exit
'
,
function
(
code
)
{
if
(
invoked
)
return
;
invoked
=
true
;
var
err
=
code
===
0
?
null
:
new
Error
(
'
exit code
'
+
code
);
callback
(
err
);
});
setTimeout
(()
=>
{
stream
.
write
(
items
+
"
,Timeout error
"
+
"
\n
"
);
process
.
kill
();
return
;
},
7200000
);
//2 hours
}
fs
.
truncateSync
(
"
./results/sitemap.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
...
...
@@ -43,4 +10,4 @@ var to_run = [{scriptPath : './add_sitemap.js', args : ['-f' ,"./test_files/SITE
{
scriptPath
:
'
./add_sitemap.js
'
,
args
:
[
'
-f
'
,
"
./test_files/SITEMAP/sitemap1000.xml
"
],
amount
:
1000
},
{
scriptPath
:
'
./add_sitemap.js
'
,
args
:
[
'
-f
'
,
"
./test_files/SITEMAP/sitemap100.xml
"
],
amount
:
100
}];
run
ScriptSync
(
to_run
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/sitemap.csv
"
,
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