Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
862870cc
Commit
862870cc
authored
Sep 21, 2022
by
Daniel Bawag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WG-70 - Modified the performance output CSV
parent
bbacabcc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
captureMetrics.js
Web-GDE/src/captureMetrics/captureMetrics.js
+11
-5
submit.js
Web-GDE/src/submit/submit.js
+2
-0
No files found.
Web-GDE/src/captureMetrics/captureMetrics.js
View file @
862870cc
...
...
@@ -11,7 +11,7 @@ const ctrl_shift_shortcuts = ['v', 'h', 'V', 'H']
const
shortcut_triggers
=
[
'Shift'
,
'Control'
]
let
shortcut_flag
=
false
const
csv_header
=
[
'
filename'
,
'speed
'
,
'avg_speed'
];
const
csv_header
=
[
'
record_no'
,
'filename'
,
'speed'
,
'eoe_timestamp
'
,
'avg_speed'
];
const
startMetricCapture
=
()
=>
{
// reset key strokes
...
...
@@ -88,13 +88,14 @@ const showMetricCapture = () => {
setTimeout
(
showMetricCapture
,
1000
);
}
const
saveMetrics
=
(
metrics
)
=>
{
const
saveMetrics
=
(
metrics
,
eoe_ts
)
=>
{
try
{
eoe_ts
=
formatDate
(
eoe_ts
);
let
rows
=
new
Array
();
if
(
sessionStorage
.
getItem
(
'csv'
)
===
null
)
{
rows
.
push
(
csv_header
);
rows
.
push
([
escapeCSV
(
File_Path
.
replace
(
/^.*
[\\\/]
/
,
''
)),
metrics
.
rate
,
metrics
.
rate
]);
rows
.
push
([
1
,
escapeCSV
(
File_Path
.
replace
(
/^.*
[\\\/]
/
,
''
)),
metrics
.
rate
,
eoe_ts
,
metrics
.
rate
]);
}
else
{
rows
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'csv'
));
let
size
=
rows
.
length
-
1
;
...
...
@@ -103,7 +104,7 @@ const saveMetrics = (metrics) => {
let
newAvg
=
((
avg
*
size
)
+
metrics
.
rate
)
/
(
size
+
1
);
rows
.
push
([
escapeCSV
(
File_Path
.
replace
(
/^.*
[\\\/]
/
,
''
)),
metrics
.
rate
,
newAvg
]);
rows
.
push
([
(
size
+
1
),
escapeCSV
(
File_Path
.
replace
(
/^.*
[\\\/]
/
,
''
)),
metrics
.
rate
,
eoe_ts
,
newAvg
]);
}
var
myFile
=
new
File
(
...
...
@@ -121,7 +122,7 @@ const saveMetrics = (metrics) => {
sessionStorage
.
setItem
(
'csv'
,
JSON
.
stringify
(
rows
));
}
catch
(
Err
){
alert
(
"Error: "
+
Err
.
description
);
console
.
log
(
"Error: "
+
Err
.
description
);
}
}
...
...
@@ -139,3 +140,7 @@ const unpauseMetricCapture = () => {
time_pause_spent
+=
(
Date
.
now
()
-
time_pause
)
/
1000
;
time_pause
=
0
;
}
const
formatDate
=
(
date
)
=>
{
return
date
.
replace
(
","
,
""
);
}
\ No newline at end of file
Web-GDE/src/submit/submit.js
View file @
862870cc
const
submitForm
=
(
e
)
=>
{
try
{
let
eoe_ts
=
new
Date
().
toLocaleString
();
const
Form
=
Settings
.
SrcElement
(
e
);
const
{
elements
}
=
Form
let
error
=
false
...
...
@@ -39,6 +40,7 @@ const submitForm = (e) => {
const
metrics
=
stopMetricCapture
();
WriteForm
(
e
,
metrics
);
saveMetrics
(
metrics
);
saveMetrics
(
metrics
,
eoe_ts
);
return
true
}
}
catch
(
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