Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
730e4cfb
Commit
730e4cfb
authored
Aug 20, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5: compress pt-query-digest reports
parent
2cf0f7fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
6 deletions
+23
-6
software/erp5/test/test/test_mariadb.py
software/erp5/test/test/test_mariadb.py
+11
-0
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+2
-0
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+3
-3
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+1
-0
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+1
-0
stack/erp5/mysql-querydigest.sh.in
stack/erp5/mysql-querydigest.sh.in
+5
-3
No files found.
software/erp5/test/test/test_mariadb.py
View file @
730e4cfb
...
...
@@ -114,8 +114,19 @@ class TestCrontabs(MariaDBTestCase):
'srv'
,
'backup'
,
'mariadb-full'
,
# TODO: this should be xz, not gz !
'*gz'
,
)))
# TODO: assert dump content
def
test_logrotate_and_slow_query_digest
(
self
):
# slow query digest needs to run after logrotate, since it operates on the rotated
# file.
import
pdb
;
pdb
.
set_trace
()
subprocess
.
check_call
(
self
.
_getCrontabCommand
(
'logrotate'
),
shell
=
True
)
self
.
assertTrue
(
glob
.
glob
(
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'srv'
,
'backup'
,
'mariadb-full'
,
'*gz'
)))
class
TestMariaDB
(
MariaDBTestCase
):
...
...
stack/erp5/buildout.cfg
View file @
730e4cfb
...
...
@@ -9,6 +9,7 @@ extends =
../../component/git/buildout.cfg
../../component/graphviz/buildout.cfg
../../component/gzip/buildout.cfg
../../component/xz-utils/buildout.cfg
../../component/haproxy/buildout.cfg
../../component/hookbox/buildout.cfg
../../component/findutils/buildout.cfg
...
...
@@ -175,6 +176,7 @@ context =
key erp5_location erp5:location
key findutils_location findutils:location
key gzip_location gzip:location
key xz_utils_location xz-utils:location
key haproxy_location haproxy:location
key instance_common_cfg instance-common:rendered
key jsl_location jsl:location
...
...
stack/erp5/buildout.hash.cfg
View file @
730e4cfb
...
...
@@ -18,7 +18,7 @@ md5sum = 85ce1e2f3d251aa435fef8118dca8a63
[mariadb-slow-query-report-script]
filename = mysql-querydigest.sh.in
md5sum =
0c0d98a68230cd0ad36046bb25b35f4a
md5sum =
7b14d2b81f2c864e47682ddb03b1b663
[mariadb-start-clone-from-backup]
filename = instance-mariadb-start-clone-from-backup.sh.in
...
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum =
1236505acbc989c9e9a8242b0a86f6fd
md5sum =
7b4b36a20b975e8b3a380a37925e1852
[template-kumofs]
filename = instance-kumofs.cfg.in
...
...
@@ -70,7 +70,7 @@ md5sum = cc19560b9400cecbd23064d55c501eec
[template]
filename = instance.cfg.in
md5sum =
328ea2bb5f2bff18f8be8c541c01f260
md5sum =
5c5250112b87a3937f939028f9594b85
[monitor-template-dummy]
filename = dummy.cfg
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
730e4cfb
...
...
@@ -326,6 +326,7 @@ context =
raw slow_query_path ${directory:srv}/backup/logrotate/mariadb_slowquery.log
raw pt_query_exec ${binary-wrap-pt-digest:wrapper-path}
raw dash {{ parameter_dict['dash-location'] }}/bin/dash
raw xz {{ parameter_dict['xz-utils-location'] }}/bin/xz
key output_folder directory:slowquery
[slow-query-digest-parameters]
...
...
stack/erp5/instance.cfg.in
View file @
730e4cfb
...
...
@@ -144,6 +144,7 @@ coreutils-location = {{ coreutils_location }}
dash-location = {{ dash_location }}
findutils-location = {{ findutils_location }}
gzip-location = {{ gzip_location }}
xz-utils-location = {{ xz_utils_location }}
mariadb-location = {{ mariadb_location }}
template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
...
...
stack/erp5/mysql-querydigest.sh.in
View file @
730e4cfb
#!{{dash}}
# BEWARE: This file is operated by slapgrid
set -e
SLOW_QUERY_PATH='{{slow_query_path}}'
OUTPUT_FOLDER='{{output_folder}}'
PT_QUERY_EXEC='{{pt_query_exec}}'
...
...
@@ -21,6 +23,6 @@ if [ ! -f "$SLOW_LOG" ]; then
exit 1
fi
"$PT_QUERY_EXEC" "$SLOW_LOG" > "$OUTPUT_FILE"
&& \
echo "Report generated successfully." || \
echo "Report failed with code $?
"
"$PT_QUERY_EXEC" "$SLOW_LOG" > "$OUTPUT_FILE"
{{ xz }} -9 "$OUTPUT_FILE
"
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