Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
10bf4413
Commit
10bf4413
authored
May 04, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the client side of server_status.
parent
7dfc0f30
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+3
-0
src/ZEO/ServerStub.py
src/ZEO/ServerStub.py
+3
-0
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+32
-1
No files found.
src/ZEO/ClientStorage.py
View file @
10bf4413
...
...
@@ -1504,6 +1504,9 @@ class ClientStorage(object):
return
self
.
_iterator_gc
(
True
)
self
.
_iterator_ids
-=
iids
def
server_status
(
self
):
return
self
.
_server
.
server_status
()
class
TransactionIterator
(
object
):
...
...
src/ZEO/ServerStub.py
View file @
10bf4413
...
...
@@ -296,6 +296,9 @@ class StorageServer:
def
iterator_gc
(
self
,
iids
):
return
self
.
rpc
.
callAsync
(
'iterator_gc'
,
iids
)
def
server_status
(
self
):
return
self
.
rpc
.
call
(
"server_status"
)
class
StorageServer308
(
StorageServer
):
def
__init__
(
self
,
rpc
):
...
...
src/ZEO/tests/testZEO.py
View file @
10bf4413
...
...
@@ -25,10 +25,13 @@ from ZODB.tests import StorageTestBase, BasicStorage, \
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
from
zope.testing
import
renormalizing
import
doctest
import
logging
import
os
import
persistent
import
re
import
shutil
import
signal
import
stat
...
...
@@ -1267,6 +1270,30 @@ def convenient_to_pass_port_to_client_and_ZEO_dot_client():
>>> client.close()
"""
def
test_server_status
():
"""
You can get server status using the server_status method.
>>> addr, _ = start_server()
>>> db = ZEO.DB(addr)
>>> import pprint
>>> pprint.pprint(db.storage.server_status(), width=1)
{'aborts': 0,
'active_txns': 0,
'commits': 1,
'conflicts': 0,
'conflicts_resolved': 0,
'connections': 1,
'loads': 1,
'lock_time': None,
'start': 'Tue May 4 10:55:20 2010',
'stores': 1,
'verifying_clients': 0,
'waiting': 0}
>>> db.close()
"""
if
sys
.
version_info
>=
(
2
,
6
):
import
multiprocessing
...
...
@@ -1383,7 +1410,11 @@ def test_suite():
zeo
=
unittest
.
TestSuite
()
zeo
.
addTest
(
unittest
.
makeSuite
(
ZODB
.
tests
.
util
.
AAAA_Test_Runner_Hack
))
zeo
.
addTest
(
doctest
.
DocTestSuite
(
setUp
=
forker
.
setUp
,
tearDown
=
zope
.
testing
.
setupstack
.
tearDown
))
setUp
=
forker
.
setUp
,
tearDown
=
zope
.
testing
.
setupstack
.
tearDown
,
checker
=
renormalizing
.
RENormalizing
([
(
re
.
compile
(
r"'start': '[^\n]+'"
),
'start'
),
]),
))
zeo
.
addTest
(
doctest
.
DocTestSuite
(
ZEO
.
tests
.
IterationTests
,
setUp
=
forker
.
setUp
,
tearDown
=
zope
.
testing
.
setupstack
.
tearDown
))
zeo
.
addTest
(
doctest
.
DocFileSuite
(
'registerDB.test'
))
...
...
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