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
2291a063
Commit
2291a063
authored
Jan 04, 2020
by
Alexandra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forgot some details
parent
00cbbbde
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
30 additions
and
16 deletions
+30
-16
Milestone1/bench_files/import_content_bench.js
Milestone1/bench_files/import_content_bench.js
+16
-0
Milestone1/bench_files/run_scripts_sync.js
Milestone1/bench_files/run_scripts_sync.js
+1
-0
Milestone1/bench_files/sitemap_bench.js
Milestone1/bench_files/sitemap_bench.js
+2
-3
Milestone1/results/sitemap.csv
Milestone1/results/sitemap.csv
+1
-0
Milestone1/unit_tests/add_csv.js
Milestone1/unit_tests/add_csv.js
+1
-0
Milestone1/unit_tests/add_sitemap.js
Milestone1/unit_tests/add_sitemap.js
+1
-0
Milestone1/unit_tests/download_content.js
Milestone1/unit_tests/download_content.js
+1
-0
Milestone1/unit_tests/download_index.js
Milestone1/unit_tests/download_index.js
+2
-1
Milestone1/unit_tests/export_content.js
Milestone1/unit_tests/export_content.js
+1
-0
Milestone1/unit_tests/export_index.js
Milestone1/unit_tests/export_index.js
+1
-0
Milestone1/unit_tests/import_content.js
Milestone1/unit_tests/import_content.js
+1
-0
Milestone1/unit_tests/import_content_bench.js
Milestone1/unit_tests/import_content_bench.js
+0
-12
Milestone1/unit_tests/import_index.js
Milestone1/unit_tests/import_index.js
+1
-0
Milestone1/unit_tests/index_csv.js
Milestone1/unit_tests/index_csv.js
+1
-0
No files found.
Milestone1/bench_files/import_content_bench.js
0 → 100644
View file @
2291a063
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_content.csv
"
,
{
flags
:
'
a
'
});
fs
.
truncateSync
(
"
./results/import_content.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
var
to_run
=
[];
fs
.
readdir
(
"
./files/CONTENT/
"
,
function
(
err
,
items
){
if
(
err
)
{
return
console
.
log
(
'
Unable to scan directory:
'
+
err
);
}
items
.
forEach
(
function
(
file
)
{
if
(
file
.
includes
(
"
zip
"
))
to_run
.
push
({
scriptPath
:
'
./unit_tests/import_content.js
'
,
args
:
[
'
-f
'
,
"
./files/CONTENT/
"
+
file
],
amount
:
parseInt
(
file
.
substring
(
25
,
file
.
length
-
4
))});
});
run
(
to_run
,
"
./results/import_content.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
});
Milestone1/bench_files/run_scripts_sync.js
View file @
2291a063
...
@@ -20,6 +20,7 @@ module.exports = {
...
@@ -20,6 +20,7 @@ module.exports = {
var
invoked
=
false
,
var
invoked
=
false
,
to_run
=
args
.
shift
();
to_run
=
args
.
shift
();
console
.
log
(
to_run
.
args
[
1
]);
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
=
childProcess
.
fork
(
to_run
.
scriptPath
,
to_run
.
args
);
process
.
on
(
'
message
'
,
function
(
mes
){
process
.
on
(
'
message
'
,
function
(
mes
){
...
...
Milestone1/bench_files/sitemap_bench.js
View file @
2291a063
...
@@ -9,9 +9,8 @@ fs.readdir("./files/SITEMAP/", function(err, items){
...
@@ -9,9 +9,8 @@ fs.readdir("./files/SITEMAP/", function(err, items){
if
(
err
)
{
if
(
err
)
{
return
console
.
log
(
'
Unable to scan directory:
'
+
err
);
return
console
.
log
(
'
Unable to scan directory:
'
+
err
);
}
}
items
.
forEach
(
function
(
file
)
{
items
.
forEach
(
function
(
file
)
{
to_run
.
push
({
scriptPath
:
'
./unit_tests/add_sitemap.js
'
,
args
:
[
'
-f
'
,
"
./files/SITEMAP/
"
+
file
],
amount
:
parseInt
(
file
.
substring
(
25
,
file
.
length
-
4
))});
to_run
.
push
({
scriptPath
:
'
./unit_tests/add_sitemap.js
'
,
args
:
[
'
-f
'
,
"
./files/SITEMAP/
"
+
file
],
amount
:
parseInt
(
file
.
substring
(
25
,
file
.
length
-
4
))});
});
});
run
(
to_run
,
"
./results/sitemap.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
run
(
to_run
,
"
./results/sitemap.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
});
});
Milestone1/results/sitemap.csv
View file @
2291a063
items,time
items,time
6.274
Milestone1/unit_tests/add_csv.js
View file @
2291a063
...
@@ -34,6 +34,7 @@ function init_server (){
...
@@ -34,6 +34,7 @@ function init_server (){
os_utils
.
cpuUsage
(
function
(
v
){
os_utils
.
cpuUsage
(
function
(
v
){
var
ramUsed
=
v
-
ramBefore
;
var
ramUsed
=
v
-
ramBefore
;
process
.
send
(
ramUsed
+
"
,
"
+
memUsed
);
process
.
send
(
ramUsed
+
"
,
"
+
memUsed
);
process
.
send
(
"
DONE
"
);
});
});
});
});
browser
.
close
();
browser
.
close
();
...
...
Milestone1/unit_tests/add_sitemap.js
View file @
2291a063
...
@@ -19,6 +19,7 @@ function init_server (){
...
@@ -19,6 +19,7 @@ function init_server (){
if
(
msg
.
includes
(
"
Done
"
)){
if
(
msg
.
includes
(
"
Done
"
)){
var
now
=
Date
.
now
();
var
now
=
Date
.
now
();
process
.
send
((
now
-
start
)
/
1000
);
process
.
send
((
now
-
start
)
/
1000
);
process
.
send
(
"
DONE
"
);
ws
.
close
();
ws
.
close
();
browser
.
close
();
browser
.
close
();
}
else
{
}
else
{
...
...
Milestone1/unit_tests/download_content.js
View file @
2291a063
...
@@ -18,6 +18,7 @@ function init_server (){
...
@@ -18,6 +18,7 @@ function init_server (){
var
total
=
Date
.
now
()
-
start
;
var
total
=
Date
.
now
()
-
start
;
//console.log("Time spent : " + total/1000 + "s");
//console.log("Time spent : " + total/1000 + "s");
process
.
send
(
total
/
1000
);
process
.
send
(
total
/
1000
);
process
.
send
(
"
DONE
"
);
// NEED TO SEND SIZE
// NEED TO SEND SIZE
}
else
{
}
else
{
console
.
log
(
"
Error :
"
+
msg
);
console
.
log
(
"
Error :
"
+
msg
);
...
...
Milestone1/unit_tests/download_index.js
View file @
2291a063
...
@@ -22,7 +22,8 @@ function init_server (){
...
@@ -22,7 +22,8 @@ function init_server (){
var
total
=
Date
.
now
()
-
start
;
var
total
=
Date
.
now
()
-
start
;
//console.log("Time spent : " + total/1000 + "s");
//console.log("Time spent : " + total/1000 + "s");
process
.
send
(
total
/
1000
);
process
.
send
(
total
/
1000
);
// NEED TO SEND SIZE
process
.
send
(
"
DONE
"
);
// NEED TO SEND SIZE
}
else
{
}
else
{
console
.
log
(
"
Error :
"
+
msg
);
console
.
log
(
"
Error :
"
+
msg
);
browser
.
close
();
browser
.
close
();
...
...
Milestone1/unit_tests/export_content.js
View file @
2291a063
...
@@ -27,6 +27,7 @@ function init_server (){
...
@@ -27,6 +27,7 @@ function init_server (){
}
else
if
(
msg
===
"
JSON
"
){
}
else
if
(
msg
===
"
JSON
"
){
plain
=
Date
.
now
()
-
plain_start
;
plain
=
Date
.
now
()
-
plain_start
;
process
.
send
(
zip
/
1000
+
"
,
"
+
plain
/
1000
);
process
.
send
(
zip
/
1000
+
"
,
"
+
plain
/
1000
);
process
.
send
(
"
DONE
"
);
ws
.
close
();
ws
.
close
();
browser
.
close
();
browser
.
close
();
}
else
{
}
else
{
...
...
Milestone1/unit_tests/export_index.js
View file @
2291a063
...
@@ -27,6 +27,7 @@ function init_server (){
...
@@ -27,6 +27,7 @@ function init_server (){
}
else
if
(
msg
===
"
JSON
"
){
}
else
if
(
msg
===
"
JSON
"
){
plain
=
Date
.
now
()
-
plain_start
;
plain
=
Date
.
now
()
-
plain_start
;
process
.
send
(
zip
/
1000
+
"
,
"
+
plain
/
1000
);
process
.
send
(
zip
/
1000
+
"
,
"
+
plain
/
1000
);
process
.
send
(
"
DONE
"
);
ws
.
close
();
ws
.
close
();
browser
.
close
();
browser
.
close
();
}
else
{
}
else
{
...
...
Milestone1/unit_tests/import_content.js
View file @
2291a063
...
@@ -25,6 +25,7 @@ function init_server (){
...
@@ -25,6 +25,7 @@ function init_server (){
if
(
msg
.
includes
(
"
Done
"
)){
if
(
msg
.
includes
(
"
Done
"
)){
var
time_spent
=
Date
.
now
()
-
start
;
var
time_spent
=
Date
.
now
()
-
start
;
process
.
send
(
time_spent
/
1000
);
process
.
send
(
time_spent
/
1000
);
process
.
send
(
"
DONE
"
);
// console.log(msg + " in " + time_spent/1000 + "s");
// console.log(msg + " in " + time_spent/1000 + "s");
browser
.
close
();
browser
.
close
();
ws
.
close
();
ws
.
close
();
...
...
Milestone1/unit_tests/import_content_bench.js
deleted
100644 → 0
View file @
00cbbbde
var
run
=
require
(
'
./run_scripts_sync
'
).
run
;
const
fs
=
require
(
'
fs
'
);
var
stream
=
fs
.
createWriteStream
(
"
./results/import_content.csv
"
,
{
flags
:
'
a
'
});
fs
.
truncateSync
(
"
./results/import_content.csv
"
);
stream
.
write
(
"
items,time
\n
"
);
var
to_run
=
[{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content100000.zip
"
],
amount
:
100000
},
{
scriptPath
:
'
./import_content.js
'
,
args
:
[
'
-f
'
,
"
./test_files/CONTENT/content10000.zip
"
],
amount
:
10000
},
{
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
(
to_run
,
"
./results/import_content.csv
"
,
function
(
err
)
{
if
(
err
)
throw
err
;});
Milestone1/unit_tests/import_index.js
View file @
2291a063
...
@@ -22,6 +22,7 @@ function init_server (){
...
@@ -22,6 +22,7 @@ function init_server (){
if
(
msg
.
includes
(
"
Done :
"
)){
if
(
msg
.
includes
(
"
Done :
"
)){
var
time_spent
=
Date
.
now
()
-
start
;
var
time_spent
=
Date
.
now
()
-
start
;
process
.
send
(
time_spent
/
1000
);
process
.
send
(
time_spent
/
1000
);
process
.
send
(
"
DONE
"
);
browser
.
close
();
browser
.
close
();
}
else
{
}
else
{
console
.
log
(
"
Error :
"
+
msg
);
console
.
log
(
"
Error :
"
+
msg
);
...
...
Milestone1/unit_tests/index_csv.js
View file @
2291a063
...
@@ -46,6 +46,7 @@ function init_server (){
...
@@ -46,6 +46,7 @@ function init_server (){
os_utils
.
cpuUsage
(
function
(
v
){
os_utils
.
cpuUsage
(
function
(
v
){
var
ramUsed
=
v
-
ramBefore
;
var
ramUsed
=
v
-
ramBefore
;
process
.
send
(
ramUsed
+
"
,
"
+
memUsed
+
"
,
"
+
adding_total
+
"
,
"
+
saving_total
);
process
.
send
(
ramUsed
+
"
,
"
+
memUsed
+
"
,
"
+
adding_total
+
"
,
"
+
saving_total
);
process
.
send
(
"
DONE
"
);
});
});
});
});
browser
.
close
();
browser
.
close
();
...
...
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