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
Xiaowu Zhang
slapos.core
Commits
a9e40960
Commit
a9e40960
authored
Jan 30, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos/collect: use memory based journal for accelerate response
parent
df5884a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
slapos/collect/db.py
slapos/collect/db.py
+6
-2
No files found.
slapos/collect/db.py
View file @
a9e40960
...
@@ -38,7 +38,9 @@ class Database:
...
@@ -38,7 +38,9 @@ class Database:
database_name
=
"collector.db"
database_name
=
"collector.db"
preserve_table_list
=
[
"heating"
]
preserve_table_list
=
[
"heating"
]
SET_PRAGMA_MODE
=
"pragma journal_mode=wal"
SET_PRAGMA_JOURNAL_MODE
=
"pragma journal_mode=memory"
SET_PRAGMA_TEMP_STORE
=
"pragma temp_store=memory"
SET_PRAGMA_CACHE_SIZE
=
"pragma cache_size=100000"
CREATE_USER_TABLE
=
"create table if not exists user "
\
CREATE_USER_TABLE
=
"create table if not exists user "
\
"(partition text, pid real, process text, "
\
"(partition text, pid real, process text, "
\
" cpu_percent real, cpu_time real, "
\
" cpu_percent real, cpu_time real, "
\
...
@@ -153,7 +155,9 @@ class Database:
...
@@ -153,7 +155,9 @@ class Database:
def
_bootstrap
(
self
):
def
_bootstrap
(
self
):
assert
self
.
CREATE_USER_TABLE
is
not
None
assert
self
.
CREATE_USER_TABLE
is
not
None
self
.
connect
()
self
.
connect
()
self
.
_execute
(
self
.
SET_PRAGMA_MODE
)
self
.
_execute
(
self
.
SET_PRAGMA_JOURNAL_MODE
)
self
.
_execute
(
self
.
SET_PRAGMA_TEMP_STORE
)
self
.
_execute
(
self
.
SET_PRAGMA_CACHE_SIZE
)
self
.
_execute
(
self
.
CREATE_USER_TABLE
)
self
.
_execute
(
self
.
CREATE_USER_TABLE
)
self
.
_execute
(
self
.
CREATE_USER_PARTITION_DATE_TIME_INDEX
)
self
.
_execute
(
self
.
CREATE_USER_PARTITION_DATE_TIME_INDEX
)
self
.
_execute
(
self
.
CREATE_FOLDER_TABLE
)
self
.
_execute
(
self
.
CREATE_FOLDER_TABLE
)
...
...
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