Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
6bf658d8
Commit
6bf658d8
authored
Jan 23, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LongRequestLogger product support.
parent
340f4ece
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
4 deletions
+42
-4
slapos/recipe/generate_erp5_tidstorage.py
slapos/recipe/generate_erp5_tidstorage.py
+22
-3
slapos/recipe/generic_zope_zeo_client/__init__.py
slapos/recipe/generic_zope_zeo_client/__init__.py
+14
-0
software/erp5/snippet-zope.cfg
software/erp5/snippet-zope.cfg
+5
-0
software/erp5/software.cfg
software/erp5/software.cfg
+1
-1
No files found.
slapos/recipe/generate_erp5_tidstorage.py
View file @
6bf658d8
...
...
@@ -101,14 +101,18 @@ class Recipe(GenericSlapRecipe):
part_list
.
append
(
zope_id
)
part_list
.
append
(
'logrotate-entry-%s'
%
zope_id
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
1
,
zope_id
=
zope_id
,
zope_port
=
current_zope_port
,
zope_timeserver
=
True
,
**
zope_dict
)
zope_port
=
current_zope_port
,
zope_timeserver
=
True
,
longrequest_logger_file
=
''
,
longrequest_logger_timeout
=
''
,
longrequest_logger_interval
=
''
,
**
zope_dict
)
# always one admin node
current_zope_port
+=
1
zope_id
=
'zope-admin'
part_list
.
append
(
zope_id
)
part_list
.
append
(
'logrotate-entry-%s'
%
zope_id
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
1
,
zope_id
=
zope_id
,
zope_port
=
current_zope_port
,
zope_timeserver
=
False
,
**
zope_dict
)
zope_port
=
current_zope_port
,
zope_timeserver
=
False
,
longrequest_logger_file
=
''
,
longrequest_logger_timeout
=
''
,
longrequest_logger_interval
=
''
,
**
zope_dict
)
# handle activity key
for
q
in
range
(
1
,
json_data
[
'activity'
][
'zopecount'
]
+
1
):
current_zope_port
+=
1
...
...
@@ -116,7 +120,9 @@ class Recipe(GenericSlapRecipe):
part_list
.
append
(
part_name
)
part_list
.
append
(
'logrotate-entry-%s'
%
part_name
)
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
1
,
zope_id
=
part_name
,
zope_port
=
current_zope_port
,
zope_timeserver
=
True
,
**
zope_dict
)
zope_port
=
current_zope_port
,
zope_timeserver
=
True
,
longrequest_logger_file
=
''
,
longrequest_logger_timeout
=
''
,
longrequest_logger_interval
=
''
,
**
zope_dict
)
# handle backend key
snippet_backend
=
open
(
self
.
options
[
'snippet-backend'
]).
read
()
publish_url_list
=
[]
...
...
@@ -127,9 +133,22 @@ class Recipe(GenericSlapRecipe):
part_name
=
'zope-%s-%s'
%
(
backend_name
,
q
)
part_list
.
append
(
part_name
)
part_list
.
append
(
'logrotate-entry-%s'
%
part_name
)
longrequest_logger
=
backend_configuration
.
get
(
"longrequest-logger"
,
None
)
if
longrequest_logger
is
not
None
:
longrequest_part_name
=
'%s-longrequest'
%
part_name
longrequest_logger_file
=
'${basedirectory:log}/%s.log'
\
%
longrequest_part_name
longrequest_logger_timeout
=
longrequest_logger
.
get
(
'timeout'
,
'4'
)
longrequest_logger_interval
=
longrequest_logger
.
get
(
'interval'
,
'2'
)
else
:
longrequest_logger_file
=
longrequest_logger_timeout
=
\
longrequest_logger_interval
=
''
output
+=
snippet_zope
%
dict
(
zope_thread_amount
=
backend_configuration
[
'thread-amount'
],
zope_id
=
part_name
,
zope_port
=
current_zope_port
,
zope_timeserver
=
False
,
longrequest_logger_file
=
longrequest_logger_file
,
longrequest_logger_timeout
=
longrequest_logger_timeout
,
longrequest_logger_interval
=
longrequest_logger_interval
,
**
zope_dict
)
haproxy_backend_list
.
append
(
'${%(part_name)s:ip}:${%(part_name)s:port}'
%
dict
(
part_name
=
part_name
))
# now generate backend access
...
...
slapos/recipe/generic_zope_zeo_client/__init__.py
View file @
6bf658d8
...
...
@@ -117,6 +117,20 @@ class Recipe(GenericBaseRecipe):
PATH
=
self
.
options
[
'bin-path'
],
TIMEZONE
=
self
.
options
[
'timezone'
],
)
# longrequestlogger product which requires environment settings
longrequest_logger_file
=
self
.
options
.
get
(
'longrequest-logger-file'
,
None
)
longrequest_logger_timeout
=
\
self
.
options
.
get
(
'longrequest-logger-timeout'
,
None
)
longrequest_logger_interval
=
\
self
.
options
.
get
(
'longrequest-logger-interval'
,
None
)
if
longrequest_logger_file
:
# add needed zope configuration
zope_environment
.
update
(
**
dict
(
longrequestlogger_file
=
longrequest_logger_file
,
longrequestlogger_timeout
=
longrequest_logger_timeout
,
longrequestlogger_interval
=
longrequest_logger_interval
))
# configure default Zope2 zcml
open
(
self
.
options
[
'site-zcml'
],
'w'
).
write
(
open
(
self
.
getTemplateFilename
(
'site.zcml'
)).
read
())
...
...
software/erp5/snippet-zope.cfg
View file @
6bf658d8
...
...
@@ -18,6 +18,11 @@ zeo-connection-string =
timeserver = %(zope_timeserver)s
# long request
longrequest-logger-file = %(longrequest_logger_file)s
longrequest-logger-timeout = %(longrequest_logger_timeout)s
longrequest-logger-interval = %(longrequest_logger_interval)s
# Paths
wrapper = $${basedirectory:services}/%(zope_id)s
instance-path = $${directory:instance}
...
...
software/erp5/software.cfg
View file @
6bf658d8
...
...
@@ -129,7 +129,7 @@ mode = 0644
[template-snippet-zope]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-zope.cfg
md5sum =
cca86232d644f0050f1f96c270867852
md5sum =
99fcce6aa6120787870522898650800d
output = ${buildout:directory}/template-snippet-zope.cfg
mode = 0644
...
...
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