Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Job Queues
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Services
Job Queues
Commits
4e958c4a
Verified
Commit
4e958c4a
authored
5 months ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: eventqueue statistic
parent
26fe680b
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.idea/workspace.xml
+4
-1
4 additions, 1 deletion
.idea/workspace.xml
manager.go
+12
-19
12 additions, 19 deletions
manager.go
nix/config/common-packages.nix
+1
-0
1 addition, 0 deletions
nix/config/common-packages.nix
nix/scripts/go-task.nix
+12
-1
12 additions, 1 deletion
nix/scripts/go-task.nix
with
29 additions
and
21 deletions
.idea/workspace.xml
+
4
−
1
View file @
4e958c4a
...
...
@@ -7,6 +7,8 @@
<list
default=
"true"
id=
"9979eb22-471e-4f2f-b624-fd3edb5e8c6e"
name=
"Changes"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/manager.go"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/manager.go"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/nix/config/common-packages.nix"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/nix/config/common-packages.nix"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/nix/scripts/go-task.nix"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/nix/scripts/go-task.nix"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -258,7 +260,8 @@
<workItem
from=
"1734022155342"
duration=
"424000"
/>
<workItem
from=
"1734024671338"
duration=
"1103000"
/>
<workItem
from=
"1734042130391"
duration=
"922000"
/>
<workItem
from=
"1734047047039"
duration=
"1146000"
/>
<workItem
from=
"1734047047039"
duration=
"1799000"
/>
<workItem
from=
"1734049269205"
duration=
"1892000"
/>
</task>
<servers
/>
</component>
...
...
This diff is collapsed.
Click to expand it.
manager.go
+
12
−
19
View file @
4e958c4a
...
...
@@ -535,7 +535,7 @@ func (m *Manager) Start() error {
}
}
m
.
jobEventCh
=
make
(
chan
any
,
100
0
)
m
.
jobEventCh
=
make
(
chan
any
,
100
)
m
.
eventBus
.
Subscribe
(
QueueJob
,
m
.
jobEventCh
)
m
.
eventBus
.
Subscribe
(
JobReady
,
m
.
jobEventCh
)
...
...
@@ -804,11 +804,6 @@ type ManagerStats struct {
}
type
SubscriberStat
struct
{
Count
int
`json:"Count"`
Added
int
`json:"Added"`
Ready
int
`json:"Ready"`
Queued
int
`json:"Queue"`
Finished
int
`json:"Finished"`
Done
int
`json:"Done"`
}
// Stats computes and returns the statistics of the job queue
...
...
@@ -822,12 +817,15 @@ func (m *Manager) Stats() ManagerStats {
processedJobsCount
:=
len
(
m
.
queue
.
processedJobs
)
pendingDependenciesCount
:=
len
(
m
.
queue
.
pendingDependencies
)
eventQueueLength
:=
len
(
m
.
jobEventCh
)
subscriberCount
:=
len
(
m
.
eventBus
.
subscribers
)
subscriberJobAdded
:=
len
(
m
.
eventBus
.
subscribers
[
JobAdded
])
subscriberJobReady
:=
len
(
m
.
eventBus
.
subscribers
[
JobReady
])
subscriberQueueJob
:=
len
(
m
.
eventBus
.
subscribers
[
QueueJob
])
subscriberJobFinished
:=
len
(
m
.
eventBus
.
subscribers
[
JobFinished
])
subscriberJobDone
:=
len
(
m
.
eventBus
.
subscribers
[
JobDone
])
subscriberCount
:=
0
for
_
,
job
:=
range
m
.
eventBus
.
subscribers
{
for
_
,
ch
:=
range
job
{
subscriberCount
+=
len
(
ch
)
}
}
return
ManagerStats
{
ReadyQueueLength
:
readyQueueLength
,
...
...
@@ -838,11 +836,6 @@ func (m *Manager) Stats() ManagerStats {
EventQueueLength
:
eventQueueLength
,
Subscriber
:
SubscriberStat
{
Count
:
subscriberCount
,
Added
:
subscriberJobAdded
,
Ready
:
subscriberJobReady
,
Queued
:
subscriberQueueJob
,
Finished
:
subscriberJobFinished
,
Done
:
subscriberJobDone
,
},
}
}
This diff is collapsed.
Click to expand it.
nix/config/common-packages.nix
+
1
−
0
View file @
4e958c4a
...
...
@@ -22,6 +22,7 @@ in [
fd
feh
gcc12
goconvey
gdlv
git
gitty
...
...
This diff is collapsed.
Click to expand it.
nix/scripts/go-task.nix
+
12
−
1
View file @
4e958c4a
...
...
@@ -24,7 +24,8 @@
run-tests:
desc: Execute all tests.
aliases:
- a
- t
- tests
env:
TEST_BY_TASK: true
USER_WORKING_DIR: "{{.USER_WORKING_DIR}}"
...
...
@@ -112,6 +113,16 @@
env:
USER_WORKING_DIR: "{{.USER_WORKING_DIR}}"
run-goconvey:
desc: Execute all tests and open the goconvey web interface.
aliases:
- goconvey
env:
TEST_BY_TASK: true
USER_WORKING_DIR: "{{.USER_WORKING_DIR}}"
cmds:
-
${
pkgs
'
.
goconvey
}
/bin/goconvey -port 7777 -workDir "{{.USER_WORKING_DIR}}"
silent: true
''
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment