Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
docker_health_check
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
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jithu.tagore
docker_health_check
Commits
91b74eab
Commit
91b74eab
authored
Nov 18, 2022
by
jithu.tagore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update infra_as_service_monitor.py
parent
7e9c0bb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
infra_as_service_monitor.py
infra_as_service_monitor.py
+28
-15
No files found.
infra_as_service_monitor.py
View file @
91b74eab
...
...
@@ -205,27 +205,34 @@ def docker_container():
calculated_time
=
0.25
if
calculated_time
==
0.25
:
timing
=
" "
elif
calculated_time
>=
3600
*
24
:
calculated_time
=
calculated_time
/
(
3600
*
24
)
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" days ago"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" day ago"
elif
calculated_time
>
3600
:
calculated_time
=
calculated_time
/
calculated_time
elif
calculated_time
>
=
3600
:
calculated_time
=
calculated_time
/
3600
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" Hours"
timing
=
str
(
round
(
calculated_time
))
+
" Hours
ago
"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" Hour"
timing
=
str
(
round
(
calculated_time
))
+
" Hour
ago
"
elif
round
(
calculated_time
)
<
60
:
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" Seconds"
timing
=
str
(
round
(
calculated_time
))
+
" Seconds
ago
"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" Second"
timing
=
str
(
round
(
calculated_time
))
+
" Second
ago
"
elif
calculated_time
>
60
:
elif
calculated_time
>
=
60
:
calculated_time
=
calculated_time
/
60
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" Minutes"
timing
=
str
(
round
(
calculated_time
))
+
" Minutes
ago
"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" Minutes"
timing
=
str
(
round
(
calculated_time
))
+
" Minutes
ago
"
data
.
append
([
container
.
name
,
container
.
id
,
container
.
attrs
[
"State"
][
"Status"
],
timing
])
...
...
@@ -249,26 +256,32 @@ def docker_container():
calculated_time
=
0.25
if
calculated_time
==
0.25
:
timing
=
""
elif
calculated_time
>
3600
*
24
:
calculated_time
=
calculated_time
/
(
3600
*
24
)
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" days ago"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" day ago"
elif
calculated_time
>
3600
:
calculated_time
=
calculated_time
/
3600
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" Hours"
timing
=
str
(
round
(
calculated_time
))
+
" Hours
ago
"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" Hour"
timing
=
str
(
round
(
calculated_time
))
+
" Hour
ago
"
elif
round
(
calculated_time
)
<
60
:
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" Seconds"
timing
=
str
(
round
(
calculated_time
))
+
" Seconds
ago
"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" Second"
timing
=
str
(
round
(
calculated_time
))
+
" Second
ago
"
elif
calculated_time
>
60
:
calculated_time
=
calculated_time
/
60
if
round
(
calculated_time
)
>
1
:
timing
=
str
(
round
(
calculated_time
))
+
" Minutes"
timing
=
str
(
round
(
calculated_time
))
+
" Minutes
ago
"
else
:
timing
=
str
(
round
(
calculated_time
))
+
" Minutes"
timing
=
str
(
round
(
calculated_time
))
+
" Minutes
ago
"
data
.
append
([
each
.
name
,
each
.
id
,
each
.
attrs
[
"State"
][
"Status"
],
timing
])
except
Exception
as
e
:
logger
.
info
(
e
)
...
...
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