Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3mon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carlo Guidi
km3mon
Commits
3dd31b90
Commit
3dd31b90
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Daemonize
parent
5f5c034c
Branches
18-restructuring-of-the-monitoring-suite
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/dom_activity.py
+16
-4
16 additions, 4 deletions
scripts/dom_activity.py
with
16 additions
and
4 deletions
scripts/dom_activity.py
+
16
−
4
View file @
3dd31b90
...
...
@@ -48,6 +48,8 @@ class DOMActivityPlotter(kp.Module):
self
.
last_activity
=
defaultdict
(
partial
(
deque
,
maxlen
=
4000
))
self
.
cuckoo
=
kp
.
time
.
Cuckoo
(
60
,
self
.
create_plot
)
print
(
self
.
log
)
self
.
log
.
warning
(
"
Starting DOM Activity monitor
"
)
def
process
(
self
,
blob
):
...
...
@@ -133,9 +135,19 @@ if __name__ == '__main__':
process_name
=
os
.
path
.
basename
(
__file__
)
pid_file
=
os
.
path
.
join
(
"
pids
"
,
process_name
+
"
.pid
"
)
daemon
=
Daemonize
(
app
=
process_name
,
pid
=
pid_file
,
action
=
main
,
chdir
=
workdir
)
logger
=
kp
.
logger
.
get_logger
(
process_name
,
filename
=
"
logs/{}.log
"
.
format
(
process_name
))
logger
.
setLevel
(
"
DEBUG
"
)
daemon
=
Daemonize
(
app
=
process_name
,
pid
=
pid_file
,
action
=
main
,
chdir
=
workdir
,
foreground
=
True
,
logger
=
logger
,
verbose
=
True
,
auto_close_fds
=
False
)
daemon
.
start
()
print
(
"
Process started with PID {}
"
.
format
(
pid_file
))
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