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
a09c1159
Commit
a09c1159
authored
Nov 17, 2022
by
jithu.tagore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update infra_as_service_monitor.py
parent
1c40478e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
infra_as_service_monitor.py
infra_as_service_monitor.py
+8
-5
No files found.
infra_as_service_monitor.py
View file @
a09c1159
...
...
@@ -181,7 +181,10 @@ def docker_container():
end
=
i
.
attrs
[
"State"
][
"FinishedAt"
]
start_date
=
dateutil
.
parser
.
isoparse
(
start
)
end_date
=
dateutil
.
parser
.
isoparse
(
end
)
print
(
end_date
)
time
=
((
end_date
-
start_date
)
.
total_seconds
())
print
(
time
)
print
(
type
(
time
))
if
i
.
attrs
[
"State"
][
"Status"
]
==
"running"
or
i
.
attrs
[
"State"
][
"Status"
]
==
"created"
:
print
(
i
.
attrs
[
"State"
][
"Status"
])
start_date
=
dateutil
.
parser
.
isoparse
(
start
)
...
...
@@ -189,17 +192,17 @@ def docker_container():
time
=
(
end_date
.
astimezone
(
datetime
.
timezone
.
utc
)
-
start_date
.
astimezone
(
datetime
.
timezone
.
utc
))
.
total_seconds
()
if
time
<
60
:
tim
e
=
str
(
int
(
time
))
+
"seconds"
tim
ing
=
str
(
int
(
time
))
+
"seconds"
if
time
>
60
:
time
=
time
/
360
0
tim
e
=
str
(
int
(
time
))
+
"minute"
time
=
time
/
6
0
tim
ing
=
str
(
int
(
time
))
+
"minute"
if
time
>
3600
:
time
=
time
/
3600
tim
e
=
str
(
int
(
time
))
+
"hour"
tim
ing
=
str
(
int
(
time
))
+
"hour"
print
(
time
)
data
.
append
([
i
.
name
,
i
.
id
,
i
.
attrs
[
"State"
][
"Status"
],
tim
e
])
data
.
append
([
i
.
name
,
i
.
id
,
i
.
attrs
[
"State"
][
"Status"
],
tim
ing
])
...
...
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