zc.monitorcache
zc.montorcache is a zc.z3monitor plugin that allows one to modify or check the cache size (in objects or bytes) of a running instance.
>>> import zc.monitorcache >>> import zope.component >>> import zc.ngi.testing >>> import zc.monitor >>> import zc.monitor.interfaces >>> import zc.z3monitor >>> import zc.z3monitor.interfaces>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> zope.component.provideUtility(zc.monitorcache.cacheMonitor, ... zc.z3monitor.interfaces.IZ3MonitorPlugin, 'cache_size')>>> connection.test_input('cache_size\n') -> CLOSE
We have no databases right now. Let’s add a few so that we can test.
>>> import ZODB.tests.util >>> import ZODB.interfaces >>> main = ZODB.tests.util.DB() >>> zope.component.provideUtility(main, ZODB.interfaces.IDatabase) >>> test = ZODB.tests.util.DB() >>> zope.component.provideUtility( ... test, ZODB.interfaces.IDatabase, 'test')
Now we should get information on each of the database’s cache sizes
>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> connection.test_input('cache_size\n') DB cache sizes for main Max objects: 400 Max object size bytes: 0MB DB cache sizes for test Max objects: 400 Max object size bytes: 0MB -> CLOSE
We can request information about a specific db as well
>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> connection.test_input('cache_size -\n') DB cache sizes for main Max objects: 400 Max object size bytes: 0MB -> CLOSE>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> connection.test_input('cache_size test\n') DB cache sizes for test Max objects: 400 Max object size bytes: 0MB -> CLOSE
We can also modify cache sizes for a specific db
>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> connection.test_input('cache_size test 300\n') Set max objects to 300 -> CLOSE>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> connection.test_input('cache_size test 10MB\n') Set max object size bytes to 10MB -> CLOSE>>> connection = zc.ngi.testing.TextConnection() >>> server = zc.monitor.Server(connection)>>> connection.test_input('cache_size test\n') DB cache sizes for test Max objects: 300 Max object size bytes: 10MB -> CLOSE
Metadata
Release files for zc.monitorcache 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zc.monitorcache-0.1.0.tar.gz | 3.0 kB | Without provenance | Details for zc.monitorcache-0.1.0.tar.gz |
Release files / zc.monitorcache-0.1.0.tar.gz
| Download URL | zc.monitorcache-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09c6daaf74379d817317e37c3a8e849f614ef7decd5a40cbe978484cf22258e6
|
|
BLAKE2b-256 checksum How to use checksums |
5e477243e382c6a961ac67dd4d44415a86d226a325c1bef54d2dfc4d93d5692e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for zc.monitorcache 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.