Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos.toolbox
Commits
cf15a299
Commit
cf15a299
authored
Jul 27, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpu_load promise: fail if the load is high than the threshold for more than 30 minutes
parent
42d7e5ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
slapos/promise/plugin/check_server_cpu_load.py
slapos/promise/plugin/check_server_cpu_load.py
+5
-2
No files found.
slapos/promise/plugin/check_server_cpu_load.py
View file @
cf15a299
...
@@ -11,6 +11,7 @@ class RunPromise(GenericPromise):
...
@@ -11,6 +11,7 @@ class RunPromise(GenericPromise):
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
GenericPromise
.
__init__
(
self
,
config
)
GenericPromise
.
__init__
(
self
,
config
)
# test load every 3 minutes
self
.
setPeriodicity
(
minute
=
3
)
self
.
setPeriodicity
(
minute
=
3
)
def
checkCPULoad
(
self
,
tolerance
=
2.2
):
def
checkCPULoad
(
self
,
tolerance
=
2.2
):
...
@@ -50,7 +51,9 @@ class RunPromise(GenericPromise):
...
@@ -50,7 +51,9 @@ class RunPromise(GenericPromise):
self
.
checkCPULoad
(
threshold
or
2.2
)
self
.
checkCPULoad
(
threshold
or
2.2
)
def
test
(
self
):
def
test
(
self
):
return
self
.
_test
(
result_count
=
5
,
failure_amount
=
5
)
# fail if load is high than the threshold for more than 30 minutes
return
self
.
_test
(
result_count
=
10
,
failure_amount
=
10
)
def
anomaly
(
self
):
def
anomaly
(
self
):
return
self
.
_test
(
result_count
=
5
,
failure_amount
=
5
)
# fail if load is high than the threshold for more than 30 minutes
return
self
.
_test
(
result_count
=
10
,
failure_amount
=
10
)
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