{ "info": { "author": "Jim Fulton", "author_email": "jim@zope.com", "bugtrack_url": null, "classifiers": [], "description": "=====================\nZope 3 Monitor Server\n=====================\n\nThe Zope 3 monitor server is a server that runs in a Zope 3 process and that\nprovides a command-line interface to request various bits of information. It\nis based on zc.monitor, which is itself based on zc.ngi, so we can use the\nzc.ngi testing infrastructure to demonstrate it.\n\nThis package provides several Zope 3 and ZODB monitoring and introspection\ntools that work within the zc.monitor server. These are demonstrated below.\n\nPlease see the zc.monitor documentation for details on how the server works.\n\nThis package also supports starting a monitor using ZConfig, and provides a\ndefault configure.zcml for registering plugins.\n\nThe ZConfig setup is not demonstrated in this documentation, but the usage is\nsimple. In your ZConfig file, provide a \"product-config\" stanza for\nzc.z3monitor that specifies the port on which the zc.monitor server should\nlisten.\n\nFor instance, this stanza will start a monitor server on port 8888::\n\n \n bind 8888\n \n\nTo bind to a specific address::\n\n \n bind 127.0.0.1:8888\n \n\nTo bind to a unix domain socket::\n\n \n bind /var/socket\n \n\nTo include the default commands of zc.monitor and zc.z3monitor, simply include\nthe configure.zcml from this package::\n\n \n\nNow let's look at the commands that this package provides. We'll get a test\nconnection to the monitor server and register the plugins that zc.monitor and\nzc.z3monitor provide.\n\n >>> import zc.ngi.testing\n >>> import zc.monitor\n >>> import zc.monitor.interfaces\n >>> import zc.z3monitor\n >>> import zc.z3monitor.interfaces\n >>> import zope.component\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> zope.component.provideUtility(zc.monitor.help,\n ... zc.monitor.interfaces.IMonitorPlugin, 'help')\n >>> zope.component.provideUtility(zc.monitor.interactive,\n ... zc.monitor.interfaces.IMonitorPlugin, 'interactive')\n >>> zope.component.provideUtility(zc.monitor.quit,\n ... zc.monitor.interfaces.IMonitorPlugin, 'quit')\n\n >>> zope.component.provideUtility(zc.z3monitor.monitor,\n ... zc.z3monitor.interfaces.IZ3MonitorPlugin, 'monitor')\n >>> zope.component.provideUtility(zc.z3monitor.dbinfo,\n ... zc.z3monitor.interfaces.IZ3MonitorPlugin, 'dbinfo')\n >>> zope.component.provideUtility(zc.z3monitor.zeocache,\n ... zc.z3monitor.interfaces.IZ3MonitorPlugin, 'zeocache')\n >>> zope.component.provideUtility(zc.z3monitor.zeostatus,\n ... zc.z3monitor.interfaces.IZ3MonitorPlugin, 'zeostatus')\n\nWe'll use the zc.monitor ``help`` command to see the list of available\ncommands:\n\n >>> connection.test_input('help\\n')\n Supported commands:\n dbinfo -- Get database statistics\n help -- Get help about server commands\n interactive -- Turn on monitor's interactive mode\n monitor -- Get general process info\n quit -- Quit the monitor\n zeocache -- Get ZEO client cache statistics\n zeostatus -- Get ZEO client status information\n -> CLOSE\n\nThe commands that come with the zc.z3monitor package use database information.\nThey access databases as utilities. Let's create some test databases and\nregister them as utilities.\n\n >>> from ZODB.tests.util import DB\n >>> main = DB()\n >>> from zope import component\n >>> import ZODB.interfaces\n >>> component.provideUtility(main, ZODB.interfaces.IDatabase)\n >>> other = DB()\n >>> component.provideUtility(other, ZODB.interfaces.IDatabase, 'other')\n\nWe also need to enable activity monitoring in the databases:\n\n >>> import ZODB.ActivityMonitor\n >>> main.setActivityMonitor(ZODB.ActivityMonitor.ActivityMonitor())\n >>> other.setActivityMonitor(ZODB.ActivityMonitor.ActivityMonitor())\n\nProcess Information\n===================\n\nTo get information about the process overall, use the monitor\ncommand:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('help monitor\\n')\n Help for monitor:\n \n Get general process info\n \n The minimal output has:\n \n - The number of open database connections to the main database, which\n is the database registered without a name.\n - The virtual memory size, and\n - The resident memory size.\n \n If there are old database connections, they will be listed. By\n default, connections are considered old if they are greater than 100\n seconds old. You can pass a minimum old connection age in seconds.\n If you pass a value of 0, you'll see all connections.\n \n If you pass a name after the integer, this is used as the database name.\n The database name defaults to the empty string ('').\n \n -> CLOSE\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('monitor\\n') #doctest: +NORMALIZE_WHITESPACE\n 0\n VmSize:\t 35284 kB\n VmRSS:\t 28764 kB\n -> CLOSE\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('monitor 100 other\\n') #doctest: +NORMALIZE_WHITESPACE\n 0\n VmSize:\t 35284 kB\n VmRSS:\t 28764 kB\n -> CLOSE\n\nNote that, as of this writing, the VmSize and VmRSS lines will only be present\non a system with procfs. This generally includes many varieties of Linux,\nand excludes OS X and Windows.\n\nLet's create a couple of connections and then call z3monitor again\nwith a value of 0:\n\n >>> conn1 = main.open()\n >>> conn2 = main.open()\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('monitor 0\\n') #doctest: +NORMALIZE_WHITESPACE\n 2\n VmSize:\t 36560 kB\n VmRSS:\t 28704 kB\n 0.0 (0)\n 0.0 (0)\n -> CLOSE\n\nThe extra line of output gives connection debug info.\nIf we set some additional input, we'll see it:\n\n >>> conn1.setDebugInfo('/foo')\n >>> conn2.setDebugInfo('/bar')\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('monitor 0\\n') #doctest: +NORMALIZE_WHITESPACE\n 2\n VmSize:\t 13048 kB\n VmRSS:\t 10084 kB\n 0.0 /bar (0)\n 0.0 /foo (0)\n -> CLOSE\n\n >>> conn1.close()\n >>> conn2.close()\n\nDatabase Information\n====================\n\nTo get information about a database, use the dbinfo command:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('help dbinfo\\n')\n Help for dbinfo:\n \n Get database statistics\n \n By default statistics are returned for the main database. The\n statistics are returned as a single line consisting of the:\n \n - number of database loads\n \n - number of database stores\n \n - number of connections in the last five minutes\n \n - number of objects in the object caches (combined)\n \n - number of non-ghost objects in the object caches (combined)\n \n You can pass a database name, where \"-\" is an alias for the main database.\n \n By default, the statistics are for a sampling interval of 5\n minutes. You can request another sampling interval, up to an\n hour, by passing a sampling interval in seconds after the database name.\n \n -> CLOSE\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('dbinfo\\n') #doctest: +NORMALIZE_WHITESPACE\n 0 0 2 0 0\n -> CLOSE\n\nLet's open a connection and do some work:\n\n >>> conn = main.open()\n >>> conn.root()['a'] = 1\n >>> import transaction\n >>> transaction.commit()\n >>> conn.root()['a'] = 1\n >>> transaction.commit()\n >>> conn.close()\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('dbinfo\\n') #doctest: +NORMALIZE_WHITESPACE\n 1 2 3 1 1\n -> CLOSE\n\nYou can specify a database name. So, to get statistics for the other\ndatabase, we'll specify the name it was registered with:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('dbinfo other\\n') #doctest: +NORMALIZE_WHITESPACE\n 0 0 0 0 0\n -> CLOSE\n\nYou can use '-' to name the main database:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('dbinfo -\\n') #doctest: +NORMALIZE_WHITESPACE\n 1 2 3 1 1\n -> CLOSE\n\nYou can specify a number of seconds to sample. For example, to get\ndata for the last 10 seconds:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('dbinfo - 10\\n') #doctest: +NORMALIZE_WHITESPACE\n 1 2 3 1 1\n -> CLOSE\n\n.. Edge case to make sure that ``deltat`` is used:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('dbinfo - 0\\n') #doctest: +NORMALIZE_WHITESPACE\n 0 0 0 1 1\n -> CLOSE\n\nZEO Cache Statistics\n====================\n\nYou can get ZEO cache statistics using the zeocache command.\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('help zeocache\\n')\n Help for zeocache:\n \n Get ZEO client cache statistics\n \n The command returns data in a single line:\n \n - the number of records added to the cache,\n \n - the number of bytes added to the cache,\n \n - the number of records evicted from the cache,\n \n - the number of bytes evicted from the cache,\n \n - the number of cache accesses.\n \n By default, data for the main database are returned. To return\n information for another database, pass the database name.\n \n -> CLOSE\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('zeocache\\n') #doctest: +NORMALIZE_WHITESPACE\n 42 4200 23 2300 1000\n -> CLOSE\n\nYou can specify a database name:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('zeocache other\\n') #doctest: +NORMALIZE_WHITESPACE\n 42 4200 23 2300 1000\n -> CLOSE\n\nZEO Connection Status\n=====================\n\nThe zeostatus command lets you get information about ZEO connection status:\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('help zeostatus\\n')\n Help for zeostatus:\n \n Get ZEO client status information\n \n The command returns True if the client is connected and False otherwise.\n \n By default, data for the main database are returned. To return\n information for another database, pass the database name.\n \n -> CLOSE\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('zeostatus\\n') #doctest: +NORMALIZE_WHITESPACE\n True\n -> CLOSE\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('zeostatus other\\n') #doctest: +NORMALIZE_WHITESPACE\n True\n -> CLOSE\n\nIn this example, we're using a faux ZEO connection. It has an\nattribute that determines whether it is connected or not. Id we\nchange it, then the zeocache output will change:\n\n >>> main._storage._is_connected = False\n\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\n >>> connection.test_input('zeostatus\\n') #doctest: +NORMALIZE_WHITESPACE\n False\n -> CLOSE\n\n\n==============\nChange History\n==============\n\n0.8.0 (2012-02-21)\n==================\n\nFeatures\n--------\n\n* New ``bind`` product-config option to bind to a specific address/socket\n Old ``port`` still useable.\n\n0.7.0 (2008-09-14)\n==================\n\nFeatures\n--------\n\n* The zc.monitor ``interactive`` mode now supports repeating the previous\n command by sending an empty line.\n\nOther\n-----\n\n* The server and the ``help``, ``interactive``, and ``quit`` commands have\n been factored out into a new zc.monitor package, on which zc.z3monitor now\n depends.\n\n0.6.0 (2008-09-14)\n==================\n\nFeatures\n--------\n\n* The new ``interactive`` command makes connections continue through multiple\n commands until you use the ``quit`` command.\n\n* The ``monitor`` command takes an optional database argument (after the legacy\n ``long`` argument).\n\n0.5.0 (2008-4-4)\n================\n\nFeatures\n--------\n\n* If the requested monitor port is in use, log and move on, rather than\n stopping the process with an exception. This lets ``zopectl debug``\n work with a running instance.\n\n0.4.1 (2008-3-31)\n=================\n\nInitial release to PyPI\n\nBug Fixes\n---------\n\n* added zope.app.appsetup to dependencies, based on failing tests\n\nOther\n-----\n\n* added comment that monitor examples currently fail on systems without procfs\n\n* tweaked setup.py for PyPI release\n\n0.4.0 (2007-11-29)\n==================\n\nNew Features\n------------\n\n* Moved ZEO cache status to the zeostatus command.\n\n0.3.0 (2007-11-29)\n==================\n\nNew Features\n------------\n\n* Commands are now provided as utilities. This means that z3monitor\n commands can be added by simply implementing simple utilities.\n\n* Added a working help command.\n\n* Added ZEO connection status to the zeocache output.\n\n0.2.0 (2007-11-15)\n==================\n\nNew Features\n------------\n\n* Added a command to get ZEO cache statistics.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "zope3", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zc.z3monitor", "package_url": "https://pypi.org/project/zc.z3monitor/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zc.z3monitor/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/zc.z3monitor/0.8.0/", "requires_dist": null, "requires_python": null, "summary": "A network-accessible command-line interface to monitor a Zope 3 process.", "version": "0.8.0" }, "last_serial": 802215, "releases": { "0.4.1": [ { "comment_text": "", "digests": { "md5": "78ef9356c7c5f8a6bbb4348f1182b45c", "sha256": "b92fbbe8b17384b4b592c405ab1b811e9befac38c5543a9b44d4177718b0473a" }, "downloads": -1, "filename": "zc.z3monitor-0.4.1.tar.gz", "has_sig": false, "md5_digest": "78ef9356c7c5f8a6bbb4348f1182b45c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11763, "upload_time": "2008-04-01T01:52:03", "url": "https://files.pythonhosted.org/packages/7c/d3/7899b648540c736819918969630742ec94bbf64682085e0f0b1cf33fb1c0/zc.z3monitor-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "f8b6f9dd1c6b71c31e57071cdd3d93d8", "sha256": "f5f66ee2767fcd8f62ba1bee4ffc5d484e13c30aedcac0fe487a58e872f52018" }, "downloads": -1, "filename": "zc.z3monitor-0.5.tar.gz", "has_sig": false, "md5_digest": "f8b6f9dd1c6b71c31e57071cdd3d93d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12346, "upload_time": "2008-04-04T15:53:47", "url": "https://files.pythonhosted.org/packages/ec/22/4b222f2c6f3064800575f2860798f12ebfa8aa76c4b1c5101147e9f44e40/zc.z3monitor-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "b55e04090ce3e16d0d2be9b4cba3888c", "sha256": "e6bbfb80da218f8d59d7dca76b77ad14272a26c4309cf0202c37f27e24d36a0f" }, "downloads": -1, "filename": "zc.z3monitor-0.5.1.tar.gz", "has_sig": false, "md5_digest": "b55e04090ce3e16d0d2be9b4cba3888c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10206, "upload_time": "2008-09-15T22:00:11", "url": "https://files.pythonhosted.org/packages/94/b6/bdb9d7e73ddb7b5a240ce91c7b77630bf8611a8ce6d30e1d9fbd6c51fa98/zc.z3monitor-0.5.1.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "48e1a55ae4bb504a729b21d2fe88efce", "sha256": "b0db74c631c2390d5b2f0e960e2c46f56992fc4257c08fdcdf2631e12ebf6fe7" }, "downloads": -1, "filename": "zc.z3monitor-0.6.0.tar.gz", "has_sig": false, "md5_digest": "48e1a55ae4bb504a729b21d2fe88efce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13541, "upload_time": "2008-09-14T17:10:45", "url": "https://files.pythonhosted.org/packages/5a/de/a9b2f4426cccb7ef2397b72bf86cd44b1d319266f37553463aa2742b04dc/zc.z3monitor-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "5ae51bff61b9ff10b678adf77d1aa364", "sha256": "7b0ecbed2b4822fc07b6500f8c6a02a6a22edb1bc3d348a70a7c4b2c59375098" }, "downloads": -1, "filename": "zc.z3monitor-0.6.1.tar.gz", "has_sig": false, "md5_digest": "5ae51bff61b9ff10b678adf77d1aa364", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11520, "upload_time": "2008-09-15T22:10:09", "url": "https://files.pythonhosted.org/packages/35/ca/7ddba9d7da2c827d66c0936c33ae31164b7590c7f7b09e588960cfaa05f8/zc.z3monitor-0.6.1.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "f254be22c27c6a9ad123bfbbae382d3a", "sha256": "42fe85d52f5ab981934cde0e6c5ec7adf85745a21331410da5c8f6d12b339829" }, "downloads": -1, "filename": "zc.z3monitor-0.7.0.tar.gz", "has_sig": false, "md5_digest": "f254be22c27c6a9ad123bfbbae382d3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12679, "upload_time": "2008-09-14T19:37:48", "url": "https://files.pythonhosted.org/packages/6c/65/7bb24e299574e416d7b79061d693abc0d5e80b13f711b99ffb3dad44cfdf/zc.z3monitor-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "5669db32a8700975b755c51af55d956b", "sha256": "c602cfbe33c1c74c82991a67883b842abef777307cd9a48521072f2bcf6ec1e2" }, "downloads": -1, "filename": "zc.z3monitor-0.8.0.tar.gz", "has_sig": false, "md5_digest": "5669db32a8700975b755c51af55d956b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13979, "upload_time": "2012-02-22T00:21:43", "url": "https://files.pythonhosted.org/packages/01/9f/8350b7a02576280ccfbee0812b31883dcf3c37f29e2da1f6609ef2309bb0/zc.z3monitor-0.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5669db32a8700975b755c51af55d956b", "sha256": "c602cfbe33c1c74c82991a67883b842abef777307cd9a48521072f2bcf6ec1e2" }, "downloads": -1, "filename": "zc.z3monitor-0.8.0.tar.gz", "has_sig": false, "md5_digest": "5669db32a8700975b755c51af55d956b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13979, "upload_time": "2012-02-22T00:21:43", "url": "https://files.pythonhosted.org/packages/01/9f/8350b7a02576280ccfbee0812b31883dcf3c37f29e2da1f6609ef2309bb0/zc.z3monitor-0.8.0.tar.gz" } ] }