[rhmessaging-commits] rhmessaging commits: r1392 - mgmt/misc.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Thu Nov 29 10:06:17 EST 2007
Author: justi9
Date: 2007-11-29 10:06:17 -0500 (Thu, 29 Nov 2007)
New Revision: 1392
Removed:
mgmt/misc/chart.py
mgmt/misc/mint-test.py
Log:
Deletes some code we no longer want.
Deleted: mgmt/misc/chart.py
===================================================================
--- mgmt/misc/chart.py 2007-11-29 14:58:41 UTC (rev 1391)
+++ mgmt/misc/chart.py 2007-11-29 15:06:17 UTC (rev 1392)
@@ -1,39 +0,0 @@
-from cairo import *
-from random import random
-
-width, height = (600, 150)
-
-surface = ImageSurface(FORMAT_ARGB32, width, height)
-
-ctx = Context(surface)
-
-ctx.set_line_width(2)
-ctx.set_source_rgb(1, 0, 0)
-
-y = 0
-
-for x in range(0, width, 10):
- change = 2 + (random() * 3)
-
- if random() > 0.40:
- if y < height - change:
- y += change
-
- else:
- if y > change:
- y -= change
-
- ctx.line_to(x, y)
-
-ctx.stroke()
-
-ctx.set_line_width(0.8)
-ctx.set_source_rgb(0.8, 0.8, 0.8)
-
-for x in range(0, width, 50):
- ctx.move_to(x, 0)
- ctx.line_to(x, height)
-
-ctx.stroke()
-
-surface.write_to_png("chart.png")
Deleted: mgmt/misc/mint-test.py
===================================================================
--- mgmt/misc/mint-test.py 2007-11-29 14:58:41 UTC (rev 1391)
+++ mgmt/misc/mint-test.py 2007-11-29 15:06:17 UTC (rev 1392)
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-from qpid.management import ManagedBroker
-from schema import *
-from time import sleep
-from datetime import *
-from sqlobject import *
-
-conn_uri = "postgresql://jross@localhost/mint"
-conn = connectionForURI(conn_uri)
-sqlhub.processConnection = conn
-
-broker_address = "dhcp83-108.boston.redhat.com:10001"
-
-def getQueueByName(name, create=False):
- try:
- queues = Queue.selectBy(name=name)[:1]
- queue = queues[0]
- except IndexError:
- if (create): queue = Queue()
- return queue
-
-def configCallback(broker, oid, list, timestamps):
- print "broker=" + broker
- if oid == 4:
- print list
- d = dict(list)
- queue = getQueueByName(d["name"], True)
- queue.set(**d)
- recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
- createdOn = datetime.fromtimestamp(timestamps[1]/1000000000)
- queue.set(recTime=recOn,creationTime=createdOn)
- print queue.id
- print " -> " + d["name"]
- return queue
-
-def instCallback(broker, oid, list, timestamps):
- print "broker=" + broker
- if oid == 4:
- print list
- d = dict(list)
- queue = getQueueByName(d.pop("name"))
- d["mgmtQueue"] = queue.id
- recOn = datetime.fromtimestamp(timestamps[0]/1000000000)
- queueStats = MgmtQueueStats()
- queueStats.set(recTime=recOn)
- queueStats.set(**d)
- if (timestamps[2] != 0):
- deletedOn = datetime.fromtimestamp(timestamps[2]/1000000000)
- queue.set(deletionTime=deletedOn)
- print queue.id
- return queueStats
-
-
-host, port = broker_address.split(":")
-target1 = ManagedBroker(host=host, port=int(port))
-target1.configListener(broker_address, configCallback)
-target1.instrumentationListener(broker_address, instCallback)
-
-target1.start ()
-
-while 1:
- sleep (1)
More information about the rhmessaging-commits
mailing list