Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix division by zero error.

Fixes #4.
  • Loading branch information...
commit 7539228c1bb0b7cee1d36716bd6f019d2ba3fc56 1 parent 1b7a9d4
@cluther cluther authored
View
8 README.markdown
@@ -15,8 +15,8 @@ Depending on what version of Zenoss you're running you will need a different
package. Download the appropriate package for your Zenoss version from the list
below.
- * Zenoss 4.1: [Latest Package for Python 2.7][]
- * Zenoss 3.0 - 4.0: [Latest Package for Python 2.6][]
+ * Zenoss 4.1 - 4.2: [Packages for Zenoss 4][]
+ * Zenoss 3.0 - 4.0: [Packages for Zenoss 3][]
Then copy it to your Zenoss server and run the following commands as the zenoss
user.
@@ -163,6 +163,6 @@ remodeled. This occur once every 12 hours.
[Zenoss]: <http://www.zenoss.com/>
-[Latest Package for Python 2.7]: <https://github.com/downloads/zenoss/ZenPacks.zenoss.PostgreSQL/ZenPacks.zenoss.PostgreSQL-1.0.3-py2.7.egg>
-[Latest Package for Python 2.6]: <https://github.com/downloads/zenoss/ZenPacks.zenoss.PostgreSQL/ZenPacks.zenoss.PostgreSQL-1.0.3-py2.6.egg>
+[Packages for Zenoss 4]: <http://zenpacks.zenoss.com/pypi/github/3.2/ZenPacks.zenoss.PostgreSQL/>
+[Packages for Zenoss 3]: <http://zenpacks.zenoss.com/pypi/github/4.2/ZenPacks.zenoss.PostgreSQL/>
[git repository]: <https://github.com/zenoss/ZenPacks.zenoss.PostgreSQL>
View
8 ZenPacks/zenoss/PostgreSQL/util.py
@@ -169,10 +169,14 @@ def getDatabaseStats(self):
for row in cursor.fetchall():
xactTotal = row[3] + row[4]
- xactRollbackPct = (float(row[4]) / xactTotal) * 100
+ xactRollbackPct = 0
+ if xactTotal > 0:
+ xactRollbackPct = (float(row[4]) / xactTotal) * 100
tupTotal = row[7] + row[8]
- tupFetchedPct = (float(row[8]) / tupTotal) * 100
+ tupFetchedPct = 0
+ if tupTotal > 0:
+ tupFetchedPct = (float(row[8]) / tupTotal) * 100
databaseStats[row[0]] = dict(
size=row[1],
View
2  setup.py
@@ -16,7 +16,7 @@
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.zenoss.PostgreSQL"
-VERSION = "1.0.3"
+VERSION = "1.0.4"
AUTHOR = "Zenoss"
LICENSE = ""
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.zenoss']
Please sign in to comment.
Something went wrong with that request. Please try again.