rhmessaging commits: r1918 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 20:46:10 -0400 (Tue, 15 Apr 2008)
New Revision: 1918
Modified:
mgmt/cumin/python/cumin/charts.py
Log:
Use alpha for value lines, so that you can tell when they overlap
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-04-15 20:15:25 UTC (rev 1917)
+++ mgmt/cumin/python/cumin/charts.py 2008-04-16 00:46:10 UTC (rev 1918)
@@ -23,7 +23,7 @@
def …
[View More]plot_values(self, samples, color=(0, 0, 0)):
cr = Context(self.surface)
cr.set_line_width(1.5)
- cr.set_source_rgb(*color)
+ cr.set_source_rgba(color[0], color[1], color[2], 0.66)
tnow = time()
[View Less]
16 years, 9 months
rhmessaging commits: r1917 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 16:15:25 -0400 (Tue, 15 Apr 2008)
New Revision: 1917
Modified:
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/stat.py
mgmt/cumin/python/cumin/stat.strings
Log:
bz438224 - Add enqueue and dequeue rate charts.
This change also starts a reorganization of stats.
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/…
[View More]queue.py 2008-04-15 17:56:07 UTC (rev 1916)
+++ mgmt/cumin/python/cumin/queue.py 2008-04-15 20:15:25 UTC (rev 1917)
@@ -231,7 +231,7 @@
self.__tabs = TabbedModeSet(app, "tabs")
self.add_child(self.__tabs)
- self.__tabs.add_tab(QueueStatistics(app, "stats"))
+ self.__tabs.add_tab(QueueStats(app, "stats"))
self.__bindings = QueueBindingSet(app, "bindings")
self.__tabs.add_tab(self.__bindings)
@@ -424,48 +424,55 @@
def render_cancel_content(self, session, binding):
return "No, Cancel"
-class QueueStatistics(TabbedModeSet):
+class QueueStats(TabbedModeSet):
def __init__(self, app, name):
- super(QueueStatistics, self).__init__(app, name)
+ super(QueueStats, self).__init__(app, name)
- self.add_tab(self.StatisticsCurrent(app, "current"))
- self.add_tab(self.StatisticsHistory(app, "history"))
+ self.add_tab(GeneralQueueStats(app, "general"))
def render_title(self, session):
return "Statistics"
- class StatisticsCurrent(Widget):
- def __init__(self, app, name):
- super(QueueStatistics.StatisticsCurrent, self).__init__(app, name)
+class GeneralQueueStats(Widget):
+ def __init__(self, app, name):
+ super(GeneralQueueStats, self).__init__(app, name)
- self.add_child(StatSet(app, "general", "general"))
- self.add_child(StatSet(app, "disk", "disk"))
- self.add_child(StatSet(app, "transactional", "transactional"))
- self.add_child(StatSet(app, "persistent", "persistent"))
- self.add_child(StatSet(app, "transaction", "transaction"))
+ self.add_child(StatSet(app, "general", "general"))
+ self.add_child(StatSet(app, "disk", "disk"))
- def render_title(self, session):
- return "Current"
+ chart = self.EnqueueDequeueRateChart(app, "enqdeq")
+ self.add_child(chart)
- class StatisticsHistory(Widget):
+ chart = self.DepthChart(app, "depth")
+ self.add_child(chart)
+
+ chart = StatValueChart(app, "consumers")
+ chart.stats = ("consumers",)
+ self.add_child(chart)
+
+ def render_title(self, session):
+ return "General"
+
+ class EnqueueDequeueRateChart(StatValueChart):
def __init__(self, app, name):
- super(QueueStatistics.StatisticsHistory, self).__init__(app, name)
+ super(GeneralQueueStats.EnqueueDequeueRateChart, self).__init__ \
+ (app, name)
- chart = StatValueChart(app, "mdepth")
- chart.stats = ("msgDepth",)
- self.add_child(chart)
+ self.stats = ("msgTotalEnqueues", "msgTotalDequeues")
+ self.mode = "rate"
- chart = StatValueChart(app, "bdepth")
- chart.stats = ("byteDepth",)
- self.add_child(chart)
+ def render_title(self, session, queue):
+ return "Enqueues and Dequeues per Second"
- chart = StatValueChart(app, "consumers")
- chart.stats = ("consumers",)
- self.add_child(chart)
+ class DepthChart(StatValueChart):
+ def __init__(self, app, name):
+ super(GeneralQueueStats.DepthChart, self).__init__(app, name)
- def render_title(self, session):
- return "History"
+ self.stats = ("msgDepth",)
+ def render_title(self, session, queue):
+ return "Queue Depth"
+
class QueueConsumerSet(PaginatedItemSet):
def get_args(self, session):
return self.frame.get_args(session)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2008-04-15 17:56:07 UTC (rev 1916)
+++ mgmt/cumin/python/cumin/queue.strings 2008-04-15 20:15:25 UTC (rev 1917)
@@ -181,38 +181,26 @@
}())
</script>
-[QueueStatistics.html]
+[QueueStats.html]
<ul class="radiotabs tabs">{tabs}</ul>
<div class="radiotabs mode">{mode}</div>
-[StatisticsCurrent.html]
-<table class="layout">
- <tr>
- <td class="twocol">
- <h2>General</h2>
- {general}
- <h2>Persistent Messages</h2>
- {persistent}
- </td>
- <td class="twocol">
- <h2>Transactional Messages</h2>
- {transactional}
- <h2>Transactions</h2>
- {transaction}
- </td>
- </tr>
-</table>
+[GeneralQueueStats.html]
+<div class="rfloat" style="width: 50%">
+ {enqdeq}
-[StatisticsHistory.html]
-<h2>Message Depth</h2>
-<div class="iblock chart">{mdepth}</div>
+ {depth}
-<h2>Byte Depth</h2>
-<div class="iblock chart">{bdepth}</div>
+ {consumers}
+</div>
-<h2>Consumers</h2>
-<div class="iblock chart">{consumers}</div>
+{general}
+<br/>
+<br/>
+<br/>
+<br/>
+
[QueueConsumerSet.html]
<div class="sactions">
<h2>Act on Selected Consumers:</h2>
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-15 17:56:07 UTC (rev 1916)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-15 20:15:25 UTC (rev 1917)
@@ -105,6 +105,10 @@
return "stats.png?" + ";".join(params)
+ def render_title(self, session, object):
+ cls = self.app.model.get_class_by_object(object)
+ return getattr(cls, self.stats[0]).title
+
def render_stats(self, session, object):
writer = Writer()
Modified: mgmt/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/cumin/python/cumin/stat.strings 2008-04-15 17:56:07 UTC (rev 1916)
+++ mgmt/cumin/python/cumin/stat.strings 2008-04-15 20:15:25 UTC (rev 1917)
@@ -41,8 +41,31 @@
}
}
+[StatSet.css]
+table.StatSet {
+ width: 25em;
+ border-collapse: collapse;
+ margin: 0.5em;
+}
+
+table.StatSet tr {
+ border-top: 1px dotted #ccc;
+ vertical-align: top;
+}
+
+table.StatSet td {
+ padding: 0.35em 0.5em;
+}
+
+table.StatSet th {
+ padding: 0.35em 0.5em;
+ text-align: left;
+ font-weight: normal;
+ background-color: #f7f7f7;
+}
+
[StatSet.html]
-<table id="{id}" class="mobjects">
+<table id="{id}" class="StatSet">
<tr>
<th style="width: 45%;">Statistic</th>
<th style="width: 20%;" class="ralign">Current</th>
@@ -79,6 +102,7 @@
img.setattr("src", src);
+/*
var ph = chart.elem("span", "class", "ph")
var statname = ph.getattr("statname")
var statmode = ph.getattr("statmode")
@@ -87,32 +111,40 @@
} else {
ph.text().set(object.stat[statname].value)
}
+*/
}
[StatValueChart.css]
-table.StatValueChart {
+div.StatValueChart {
font-size: 0.9em;
+ margin: 0 0 1em 1em;
+ width: 30em;
}
-table.StatValueChart span.swatch {
- padding: 0 0.4em;
+div.StatValueChart h2 {
+ margin: 0;
}
-table.StatValueChart ul.radiotabs li {
- display: block;
+div.StatValueChart div.duration {
+ margin: 1em 1em 0.5em 1em;
}
+div.StatValueChart ul.radiotabs {
+ margin: 0;
+}
+
+div.StatValueChart img {
+ margin: 0 1em;
+}
+
[StatValueChart.html]
-<table class="StatValueChart" id="{id}">
- <tr>
- <td><img id="{id}" src="{href}" height="100" width="360"/></td>
- <td>
- <ul>{stats}</ul>
- <br/>
- {duration}
- </td>
- </tr>
-</table>
+<div class="StatValueChart" id="{id}">
+ <h2>{title}</h2>
+
+ <div class="duration">{duration}</div>
+
+ <img id="{id}" src="{href}" height="100" width="360"/>
+</div>
<script>
cumin.objectListeners["{id}"] = updateChart
</script>
[View Less]
16 years, 9 months
rhmessaging commits: r1916 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 13:56:07 -0400 (Tue, 15 Apr 2008)
New Revision: 1916
Modified:
mgmt/cumin/python/cumin/charts.py
Log:
Some adjustments to text position
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-04-15 17:41:19 UTC (rev 1915)
+++ mgmt/cumin/python/cumin/charts.py 2008-04-15 17:56:07 UTC (rev 1916)
@@ -14,7 +14,7 @@
self.width = width - 60
self.…
[View More]height = height - 20
self.surface = ImageSurface(FORMAT_ARGB32, width, height)
- self.surface.set_device_offset(0.5, 8.5)
+ self.surface.set_device_offset(1.5, 5.5)
self.x_max = 1
self.x_min = 0
self.y_max = 1
@@ -85,7 +85,8 @@
x = self.width - (i * interval)
cr.move_to(x, 0)
- cr.line_to(x, self.height + 10)
+ cr.line_to(x, self.height + 12)
+ cr.move_to(x + 2, self.height + 12)
if i % step == 0:
value = absmax - (absmax * x / float(self.width))
@@ -106,7 +107,8 @@
y = self.height - (i * interval)
cr.move_to(0, y)
- cr.line_to(self.width + 2, y)
+ cr.line_to(self.width + 3, y)
+ cr.move_to(self.width + 4, y + 3)
if i % step == 0:
fraction = (self.height - y) / float(self.height)
@@ -117,7 +119,7 @@
svalue = "%ik" % int(round(value / 1000.0, -1))
else:
svalue = str(value)
-
+
cr.show_text(svalue)
cr.stroke()
[View Less]
16 years, 9 months
rhmessaging commits: r1915 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 13:41:19 -0400 (Tue, 15 Apr 2008)
New Revision: 1915
Modified:
mgmt/cumin/python/cumin/charts.py
mgmt/cumin/python/cumin/stat.py
Log:
Add a method to draw legends on charts.
Eliminate an unused stroke wrapper.
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-04-15 15:56:58 UTC (rev 1914)
+++ mgmt/cumin/python/cumin/charts.py 2008-04-15 17:41:19 UTC …
[View More](rev 1915)
@@ -22,7 +22,7 @@
def plot_values(self, samples, color=(0, 0, 0)):
cr = Context(self.surface)
- cr.set_line_width(2)
+ cr.set_line_width(1.5)
cr.set_source_rgb(*color)
tnow = time()
@@ -38,8 +38,30 @@
y = self.height - (value / float(self.y_max)) * self.height
cr.line_to(x, y)
- self.stroke(cr)
+ cr.stroke()
+ def plot_legend(self, titles, colors):
+ cr = Context(self.surface)
+
+ for i, item in enumerate(zip(titles, colors)):
+ title, color = item
+ y = 16 + i * 16
+
+ cr.set_source_rgba(1, 1, 1, 0.75)
+ cr.rectangle(4, y - 12, 16 + 6.5 * len(title), 16)
+ cr.fill()
+ cr.stroke()
+
+ cr.set_source_rgb(*color)
+ cr.rectangle(8, y, 8, -8)
+ cr.fill()
+ cr.stroke()
+
+ cr.move_to(20, y)
+ cr.set_source_rgb(0, 0, 0)
+ cr.show_text(title)
+ cr.stroke()
+
def plot_frame(self, color=(0.8, 0.8, 0.8)):
cr = Context(self.surface)
cr.set_line_width(1)
@@ -49,7 +71,7 @@
cr.line_to(self.width, self.height)
cr.line_to(0, self.height)
- self.stroke(cr)
+ cr.stroke()
def plot_x_axis(self, intervals, step):
cr = Context(self.surface)
@@ -71,7 +93,7 @@
if text:
cr.show_text(text)
- self.stroke(cr)
+ cr.stroke()
def plot_y_axis(self, intervals, step):
cr = Context(self.surface)
@@ -98,9 +120,6 @@
cr.show_text(svalue)
- self.stroke(cr)
-
- def stroke(self, cr):
cr.stroke()
def write(self, writer):
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-15 15:56:58 UTC (rev 1914)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-15 17:41:19 UTC (rev 1915)
@@ -244,6 +244,9 @@
chart.plot_frame()
+ titles = [x.title for x in stats]
+ chart.plot_legend(titles, colors)
+
writer = Writer()
chart.write(writer)
return writer.to_string()
[View Less]
16 years, 9 months
rhmessaging commits: r1914 - mgmt.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-04-15 11:56:58 -0400 (Tue, 15 Apr 2008)
New Revision: 1914
Modified:
mgmt/cumin.spec
Log:
add svn revision tag to specfile
Modified: mgmt/cumin.spec
===================================================================
--- mgmt/cumin.spec 2008-04-15 15:27:46 UTC (rev 1913)
+++ mgmt/cumin.spec 2008-04-15 15:56:58 UTC (rev 1914)
@@ -1,3 +1,5 @@
+# svn revision: $Rev$
+
Summary: management component of MRG
Name: cumin
Version: 0.1
…
[View More]Property changes on: mgmt/cumin.spec
___________________________________________________________________
Name: svn:keywords
+ Revision
[View Less]
16 years, 9 months
rhmessaging commits: r1913 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 11:27:46 -0400 (Tue, 15 Apr 2008)
New Revision: 1913
Modified:
mgmt/cumin/python/cumin/formats.py
Log:
Simplify and fix duration formatters
Modified: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py 2008-04-15 15:10:04 UTC (rev 1912)
+++ mgmt/cumin/python/cumin/formats.py 2008-04-15 15:27:46 UTC (rev 1913)
@@ -25,12 +25,12 @@
units = ("day", "hour", "min", "sec")…
[View More]
for period, unit in zip(periods, units):
- if secs > period:
+ if secs >= period:
count = secs // period
elems.append("%i %s%s" % (count, unit, ess(count)))
if len(elems) == 2:
- return ", ".join(elems) + sign
+ break
secs = secs % period
@@ -47,12 +47,12 @@
units = ("d", "h", "m", "s")
for period, unit in zip(periods, units):
- if secs > period:
+ if secs >= period:
count = secs // period
elems.append("%i%s" % (count, unit))
if len(elems) == 2:
- return sign + "".join(elems)
+ break
secs = secs % period
[View Less]
16 years, 9 months
rhmessaging commits: r1912 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 11:10:04 -0400 (Tue, 15 Apr 2008)
New Revision: 1912
Modified:
mgmt/cumin/python/cumin/charts.py
mgmt/cumin/python/cumin/stat.py
mgmt/cumin/python/cumin/stat.strings
Log:
Use the passed in dimensions for to set the overall surface (and thus image) dimensions, rather than just the internal chart subregion
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py …
[View More]2008-04-15 14:59:55 UTC (rev 1911)
+++ mgmt/cumin/python/cumin/charts.py 2008-04-15 15:10:04 UTC (rev 1912)
@@ -11,9 +11,9 @@
class TimeSeriesChart(object):
def __init__(self, width, height):
- self.width = width
- self.height = height
- self.surface = ImageSurface(FORMAT_ARGB32, width + 60, height + 20)
+ self.width = width - 60
+ self.height = height - 20
+ self.surface = ImageSurface(FORMAT_ARGB32, width, height)
self.surface.set_device_offset(0.5, 8.5)
self.x_max = 1
self.x_min = 0
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-15 14:59:55 UTC (rev 1911)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-15 15:10:04 UTC (rev 1912)
@@ -168,7 +168,7 @@
return (cls.get(id),)
def do_render(self, session, object):
- chart = TimeSeriesChart(320, 80)
+ chart = TimeSeriesChart(360, 100)
cls = self.class_.get(session)
stats = [getattr(cls, x) for x in self.stats.get(session)]
Modified: mgmt/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/cumin/python/cumin/stat.strings 2008-04-15 14:59:55 UTC (rev 1911)
+++ mgmt/cumin/python/cumin/stat.strings 2008-04-15 15:10:04 UTC (rev 1912)
@@ -105,7 +105,7 @@
[StatValueChart.html]
<table class="StatValueChart" id="{id}">
<tr>
- <td><img id="{id}" src="{href}" height="100" width="380"/></td>
+ <td><img id="{id}" src="{href}" height="100" width="360"/></td>
<td>
<ul>{stats}</ul>
<br/>
[View Less]
16 years, 9 months
rhmessaging commits: r1911 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-15 10:59:55 -0400 (Tue, 15 Apr 2008)
New Revision: 1911
Modified:
mgmt/cumin/python/cumin/charts.py
mgmt/cumin/python/cumin/stat.py
Log:
Give the existing chart code a more descriptive name
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-04-15 12:23:14 UTC (rev 1910)
+++ mgmt/cumin/python/cumin/charts.py 2008-04-15 14:59:55 UTC (rev 1911)
@@ -9,7 +9,7 @@…
[View More]
log = logging.getLogger("cumin.chart")
-class LineChart(object):
+class TimeSeriesChart(object):
def __init__(self, width, height):
self.width = width
self.height = height
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-15 12:23:14 UTC (rev 1910)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-15 14:59:55 UTC (rev 1911)
@@ -168,7 +168,7 @@
return (cls.get(id),)
def do_render(self, session, object):
- chart = LineChart(320, 80)
+ chart = TimeSeriesChart(320, 80)
cls = self.class_.get(session)
stats = [getattr(cls, x) for x in self.stats.get(session)]
[View Less]
16 years, 9 months
rhmessaging commits: r1910 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-15 08:23:14 -0400 (Tue, 15 Apr 2008)
New Revision: 1910
Modified:
store/trunk/cpp/tests/system_test.sh
Log:
BZ431693: This bug appears to have been resolved by recent development work on the management module in the broker. Removed -m 0 workaround.
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2008-04-14 21:22:21 UTC (rev 1909)
+++ store/trunk/cpp/tests/…
[View More]system_test.sh 2008-04-15 12:23:14 UTC (rev 1910)
@@ -74,8 +74,8 @@
fi
for p in `seq 1 8`; do
log="$abs_srcdir/vg-log.$mode.$p"
- #echo "$vg $QPIDD -m 0 --data dir "" --load-module $LIBBDBSTORE $JRNLFLAGS"
- $vg $QPIDD -m 0 --data-dir "" --load-module $LIBBDBSTORE --auth no $JRNLFLAGS >> "$abs_srcdir/qpid.log" 2> $log & pid=$!
+ #echo "$vg $QPIDD --data dir "" --load-module $LIBBDBSTORE --auth no $JRNLFLAGS"
+ $vg $QPIDD --data-dir "" --load-module $LIBBDBSTORE --auth no $JRNLFLAGS >> "$abs_srcdir/qpid.log" 2> $log & pid=$!
sleep 5
echo phase $p...
[View Less]
16 years, 9 months
rhmessaging commits: r1909 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-14 17:22:21 -0400 (Mon, 14 Apr 2008)
New Revision: 1909
Modified:
mgmt/cumin/python/cumin/charts.py
mgmt/cumin/python/cumin/stat.py
mgmt/cumin/python/cumin/stat.strings
Log:
Change the way intervals are computed and displayed in charts.
Shrink charts in preparation for using them in a new location.
Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py 2008-…
[View More]04-14 17:05:54 UTC (rev 1908)
+++ mgmt/cumin/python/cumin/charts.py 2008-04-14 21:22:21 UTC (rev 1909)
@@ -51,15 +51,17 @@
self.stroke(cr)
- def plot_x_axis(self, interval, step):
+ def plot_x_axis(self, intervals, step):
cr = Context(self.surface)
cr.set_line_width(0.2)
cr.set_source_rgb(0.6, 0.6, 0.6)
+ interval = self.width / float(intervals)
absmax = self.x_max - self.x_min
- i = 0
- for x in range(self.width, 0 - interval, -interval):
+ for i in range(0, intervals + 1):
+ x = self.width - (i * interval)
+
cr.move_to(x, 0)
cr.line_to(x, self.height + 10)
@@ -69,39 +71,33 @@
if text:
cr.show_text(text)
- i += 1
-
self.stroke(cr)
- def plot_y_axis(self, interval, step):
+ def plot_y_axis(self, intervals, step):
cr = Context(self.surface)
cr.set_line_width(0.2)
cr.set_source_rgb(0.6, 0.6, 0.6)
- i = 0
+ interval = self.height / float(intervals)
- for y in range(0, self.height, interval):
+ for i in range(0, intervals + 1):
+ y = self.height - (i * interval)
+
cr.move_to(0, y)
cr.line_to(self.width + 2, y)
if i % step == 0:
fraction = (self.height - y) / float(self.height)
value = fraction * self.y_max - self.y_min
- value = value + self.y_min
+ value = int(round(value + self.y_min))
- if value == 0:
- svalue = "0"
- elif value < 10:
- svalue = str(value)
- elif value > 10000:
- svalue = "%ik" % int(round(value / 1000, -1))
+ if value > 10000:
+ svalue = "%ik" % int(round(value / 1000.0, -1))
else:
- svalue = str(int(round(value, -1)))
+ svalue = str(value)
cr.show_text(svalue)
- i += 1
-
self.stroke(cr)
def stroke(self, cr):
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-14 17:05:54 UTC (rev 1908)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-14 21:22:21 UTC (rev 1909)
@@ -168,7 +168,7 @@
return (cls.get(id),)
def do_render(self, session, object):
- chart = LineChart(480, 120)
+ chart = LineChart(320, 80)
cls = self.class_.get(session)
stats = [getattr(cls, x) for x in self.stats.get(session)]
@@ -222,20 +222,20 @@
chart.y_max = max_value
chart.y_min = min_value
- x_interval = 40
+ x_intervals = 8
x_step = 2
if chart.x_max == 600:
- x_interval = 48
+ x_intervals = 10
- y_interval = 15
+ y_intervals = 6
y_step = 2
- if chart.y_max < 4:
- y_step = 4
+ if chart.y_max < 3:
+ y_step = 3
- chart.plot_x_axis(x_interval, x_step)
- chart.plot_y_axis(y_interval, y_step)
+ chart.plot_x_axis(x_intervals, x_step)
+ chart.plot_y_axis(y_intervals, y_step)
colors = ((1,0,0), (0,0,1), (0,1,0))
Modified: mgmt/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/cumin/python/cumin/stat.strings 2008-04-14 17:05:54 UTC (rev 1908)
+++ mgmt/cumin/python/cumin/stat.strings 2008-04-14 21:22:21 UTC (rev 1909)
@@ -105,7 +105,7 @@
[StatValueChart.html]
<table class="StatValueChart" id="{id}">
<tr>
- <td><img id="{id}" src="{href}" height="140" width="540"/></td>
+ <td><img id="{id}" src="{href}" height="100" width="380"/></td>
<td>
<ul>{stats}</ul>
<br/>
[View Less]
16 years, 9 months