{ "info": { "author": "David Gildeh", "author_email": "david.gildeh@outlyer.com", "bugtrack_url": null, "classifiers": [], "description": "# JMXQuery Python Module\n\nProvides a Python module to easily run queries and collect metrics from a Java Virtual Machine via JMX.\n\nIn order to use this module, provide a list of queries, and the module will return all of the values it \nfinds matching the query. Please note that the interfact to the JMX uses a small jar file contained in \nthis module, so you will need to have java installed on the machine you're running this module on.\n\n## Usage\n\nThis example query for a Kafka server will get all cluster partition metrics:\n\n```\njmxConnection = JMXConnection(\"service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi\")\njmxQuery = [JMXQuery(\"kafka.cluster:type=*,name=*,topic=*,partition=*\",\n metric_name=\"kafka_cluster_{type}_{name}\",\n metric_labels={\"topic\" : \"{topic}\", \"partition\" : \"{partition}\"})]\nmetrics = jmxConnection.query(jmxQuery)\nfor metric in metrics:\n print(f\"{metric.metric_name}<{metric.metric_labels}> == {metric.value}\")\n```\n\nThis will return the following:\n\n```\nkafka_cluster_Partition_UnderReplicated<{'partition': '0', 'topic': 'test'}> == 0\nkafka_cluster_Partition_UnderMinIsr<{'partition': '0', 'topic': 'test'}> == 0\nkafka_cluster_Partition_InSyncReplicasCount<{'partition': '0', 'topic': 'test'}> == 1\nkafka_cluster_Partition_ReplicasCount<{'partition': '0', 'topic': 'test'}> == 1\nkafka_cluster_Partition_LastStableOffsetLag<{'partition': '0', 'topic': 'test'}> == 0\n```\n\nAs you will notice you can optionally send a metric_name and metric_labels with {} tokens in them. These\ntokens are replaced at runtime by the jar so you can easily build metric names with associated labels using\nthe MBean properties of the values your query pulls back. \n\nYou can also use the module to pull back a list of all the MBean values available in the JVM too:\n\n```\njmxConnection = JMXConnection(\"service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi\")\njmxQuery = [JMXQuery(\"*:*\")]\nmetrics = jmxConnection.query(jmxQuery)\nfor metric in metrics:\n print(f\"{metric.to_query_string()} ({metric.value_type}) = {metric.value}\")\n```\n\n## Installation\n\nJust use pip to install the module in your Python environment:\n\n```\npip install jmxquery\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/outlyerapp/jmxquery", "keywords": "java", "license": "", "maintainer": "", "maintainer_email": "", "name": "jmxquery", "package_url": "https://pypi.org/project/jmxquery/", "platform": "", "project_url": "https://pypi.org/project/jmxquery/", "project_urls": { "Homepage": "https://github.com/outlyerapp/jmxquery" }, "release_url": "https://pypi.org/project/jmxquery/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "A JMX Interface for Python to Query runtime metrics in a JVM", "version": "0.5.0" }, "last_serial": 3866676, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b3584732de445c591b15578955d8cf0e", "sha256": "d6b457df3dd156f2b88eb01412faceaef7c3071626541d420b9ccaccd27c9294" }, "downloads": -1, "filename": "jmxquery-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b3584732de445c591b15578955d8cf0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19905, "upload_time": "2018-02-21T19:29:28", "url": "https://files.pythonhosted.org/packages/5f/d2/01905ba1b120eccaeae6d0b55c5c6fff540d33830d44d58aed36a60a0b69/jmxquery-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "d8391ce940b804d82c9e1805abb46b70", "sha256": "d53eadd90db49eb37601f119f4d4a5aad7de03193ccdba39fd67d22ffc5a3718" }, "downloads": -1, "filename": "jmxquery-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d8391ce940b804d82c9e1805abb46b70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20162, "upload_time": "2018-02-22T08:55:17", "url": "https://files.pythonhosted.org/packages/2c/27/d0c2982640cc9a8bf6c9e7f40c561039241f58d53abb623f58f43ffc1852/jmxquery-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e120b7fb49fdfe6e4726ba8d1a7e0cdc", "sha256": "e89296b0cba859eba55e8f74fd4353bd84ad152f106f6dcf4c2ed564e7c64b2b" }, "downloads": -1, "filename": "jmxquery-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e120b7fb49fdfe6e4726ba8d1a7e0cdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20285, "upload_time": "2018-02-27T01:38:11", "url": "https://files.pythonhosted.org/packages/64/ea/d23a3f032e607f48e02abbd432a9bb25ae1e818dc41a33e28784a47314b8/jmxquery-0.3.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "0733510e10f4f6aa458423050803ba02", "sha256": "90aff0684fea250add5a8e2bd3eb396bdeb3ecf2869d4c5c52be1bb35d496021" }, "downloads": -1, "filename": "jmxquery-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0733510e10f4f6aa458423050803ba02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20534, "upload_time": "2018-05-15T23:22:26", "url": "https://files.pythonhosted.org/packages/93/02/b079e4df07f4c23bc5759742c488673008327dcd14713b519a96c7cc3e94/jmxquery-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0733510e10f4f6aa458423050803ba02", "sha256": "90aff0684fea250add5a8e2bd3eb396bdeb3ecf2869d4c5c52be1bb35d496021" }, "downloads": -1, "filename": "jmxquery-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0733510e10f4f6aa458423050803ba02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20534, "upload_time": "2018-05-15T23:22:26", "url": "https://files.pythonhosted.org/packages/93/02/b079e4df07f4c23bc5759742c488673008327dcd14713b519a96c7cc3e94/jmxquery-0.5.0.tar.gz" } ] }