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
992972f4
Commit
992972f4
authored
Nov 16, 2022
by
jithu.tagore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update infra_as_service_monitor.py
parent
b2f39268
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
infra_as_service_monitor.py
infra_as_service_monitor.py
+2
-3
No files found.
infra_as_service_monitor.py
View file @
992972f4
...
...
@@ -174,7 +174,6 @@ def docker_container():
try
:
docker_client
=
docker
.
from_env
()
containers
=
docker_client
.
containers
.
list
(
all
=
True
)
time
=
datetime
.
datetime
.
now
(
tz
=
datetime
.
timezone
.
utc
)
for
i
in
containers
:
if
i
.
attrs
[
"State"
][
"Status"
]
==
"restarting"
or
i
.
attrs
[
"State"
][
"Status"
]
==
"exited"
:
container_restart
.
append
(
i
)
...
...
@@ -183,12 +182,12 @@ def docker_container():
start_date
=
dateutil
.
parser
.
isoparse
(
start
)
end_date
=
dateutil
.
parser
.
isoparse
(
end
)
time
=
((
end_date
-
start_date
)
.
total_seconds
())
print
(
"actual:"
,
time
.
total_seconds
()
)
print
(
"actual:"
,
time
)
if
i
.
attrs
[
"State"
][
"Status"
]
==
"running"
or
i
.
attrs
[
"State"
][
"Status"
]
==
"created"
:
start_date
=
dateutil
.
parser
.
isoparse
(
start
)
end_date
=
datetime
.
datetime
.
now
(
tz
=
datetime
.
timezone
.
utc
)
time
=
(
end_date
.
astimezone
(
datetime
.
timezone
.
utc
)
-
start_date
.
astimezone
(
datetime
.
timezone
.
utc
))
.
total_seconds
()
print
(
"actual:"
,
time
.
total_seconds
()
)
print
(
"actual:"
,
time
)
print
(
type
(
time
))
# time=int(time)
# if time<60:
...
...
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