Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
cd2f8819
Commit
cd2f8819
authored
Sep 16, 2023
by
Evan W. Patton
Committed by
Jeffrey Schiller
Oct 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix misaligned buildserver stat reports
Change-Id: I5a158bef21dc31133c1510ed4c10fcc6eae941cc
parent
566a1e84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
appinventor/buildserver/src/com/google/appinventor/buildserver/stats/SimpleStatReporter.java
...gle/appinventor/buildserver/stats/SimpleStatReporter.java
+13
-2
No files found.
appinventor/buildserver/src/com/google/appinventor/buildserver/stats/SimpleStatReporter.java
View file @
cd2f8819
...
...
@@ -59,6 +59,7 @@ public class SimpleStatReporter implements StatReporter {
}
private
final
Map
<
Compiler
,
BuildStats
>
activeBuilds
=
new
HashMap
<>();
private
final
Map
<
Compiler
,
String
>
currentStages
=
new
HashMap
<>();
private
final
Deque
<
BuildStats
>
successfulBuilds
=
new
LinkedList
<>();
private
final
Deque
<
BuildStats
>
failedBuilds
=
new
LinkedList
<>();
...
...
@@ -70,24 +71,31 @@ public class SimpleStatReporter implements StatReporter {
}
@Override
public
void
nextStage
(
Compiler
compiler
,
String
s
tage
)
{
public
void
nextStage
(
Compiler
compiler
,
String
newS
tage
)
{
BuildStats
stats
;
String
previousStage
;
synchronized
(
this
)
{
stats
=
activeBuilds
.
get
(
compiler
);
previousStage
=
currentStages
.
get
(
compiler
);
}
if
(
stats
==
null
)
{
LOG
.
warning
(
"Got compiler with uninitialized stats object"
);
return
;
}
stats
.
stages
.
put
(
stage
,
System
.
currentTimeMillis
()
-
stats
.
last
);
if
(
previousStage
!=
null
)
{
stats
.
stages
.
put
(
previousStage
,
System
.
currentTimeMillis
()
-
stats
.
last
);
}
currentStages
.
put
(
compiler
,
newStage
);
stats
.
last
=
System
.
currentTimeMillis
();
}
@Override
public
void
stopBuild
(
Compiler
compiler
,
boolean
success
)
{
BuildStats
stats
;
String
previousStage
;
synchronized
(
this
)
{
stats
=
activeBuilds
.
remove
(
compiler
);
previousStage
=
currentStages
.
remove
(
compiler
);
}
if
(
stats
==
null
)
{
LOG
.
warning
(
"Got compiler with uninitialized stats object"
);
...
...
@@ -95,6 +103,9 @@ public class SimpleStatReporter implements StatReporter {
}
stats
.
end
=
System
.
currentTimeMillis
();
stats
.
duration
=
stats
.
end
-
stats
.
start
;
if
(
previousStage
!=
null
)
{
stats
.
stages
.
put
(
previousStage
,
stats
.
end
-
stats
.
last
);
}
queueAndExpire
(
stats
,
success
?
successfulBuilds
:
failedBuilds
);
queueAndExpire
(
stats
,
orderedBuilds
);
}
...
...
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