Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Ivan Tyagov
slapos.core
Commits
8307f425
Commit
8307f425
authored
Oct 26, 2019
by
Rafael Monnerat
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos/collect: Use UTC time for collector.db time queries
parent
d7662787
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
slapos/collect/reporter.py
slapos/collect/reporter.py
+6
-6
No files found.
slapos/collect/reporter.py
View file @
8307f425
...
...
@@ -197,11 +197,11 @@ class ConsumptionReportBase(object):
if
where
:
where
=
"and %s"
%
where
if
not
date_scope
:
date_scope
=
datetime
.
now
().
strftime
(
'%Y-%m-%d'
)
date_scope
=
datetime
.
utc
now
().
strftime
(
'%Y-%m-%d'
)
if
not
min_time
:
min_time
=
(
datetime
.
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:00'
)
min_time
=
(
datetime
.
utc
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:00'
)
if
not
max_time
:
max_time
=
(
datetime
.
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:59'
)
max_time
=
(
datetime
.
utc
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:59'
)
columns
=
"""count(pid), SUM(cpu_percent) as cpu_result, SUM(cpu_time),
MAX(cpu_num_threads), SUM(memory_percent),
...
...
@@ -243,11 +243,11 @@ class ConsumptionReportBase(object):
if
where
:
where
=
" and %s"
%
where
if
not
date_scope
:
date_scope
=
datetime
.
now
().
strftime
(
'%Y-%m-%d'
)
date_scope
=
datetime
.
utc
now
().
strftime
(
'%Y-%m-%d'
)
if
not
min_time
:
min_time
=
(
datetime
.
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:00'
)
min_time
=
(
datetime
.
utc
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:00'
)
if
not
max_time
:
max_time
=
(
datetime
.
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:59'
)
max_time
=
(
datetime
.
utc
now
()
-
timedelta
(
minutes
=
1
)).
strftime
(
'%H:%M:59'
)
colums
=
"""count(pid), SUM(cpu_percent), SUM(cpu_time),
SUM(cpu_num_threads), SUM(memory_percent), SUM(memory_rss),
...
...
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