On 01/30/2012 11:00 AM, Matt Wagner wrote:
On Mon, Jan 30, 2012 at 03:37:58PM +0100, jzigmund(a)redhat.com wrote:
> From: Jozef Zigmund<jzigmund(a)redhat.com>
>
> If pool.statistics[:instances_failed] is empty, it shows 0 now. Before it showed
ActiveRecord object.
>
>
https://bugzilla.redhat.com/show_bug.cgi?id=782336
> ---
> src/app/views/pool_families/_pools.html.haml | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/app/views/pool_families/_pools.html.haml
b/src/app/views/pool_families/_pools.html.haml
> index 50a8c00..4c635f3 100644
> --- a/src/app/views/pool_families/_pools.html.haml
> +++ b/src/app/views/pool_families/_pools.html.haml
> @@ -4,7 +4,7 @@
> %td{:class => 'center'}= pool.deployments.count
> %td{:class => 'center'}= pool.statistics[:total_instances]
> %td{:class => 'center'}= pool.statistics[:instances_pending]
> - %td{:class => 'center'}= pool.statistics[:instances_failed]
> + %td{:class => 'center'}= pool.statistics[:instances_failed].empty? ?
0 : pool.statistics[:instances_failed]
> %td{:class => 'center'}= pool.statistics[:quota_percent]
> %td{:class => 'center'}= pool.statistics[:used_quota]
> %td{:class => 'center'}= pool.statistics[:available_quota].nil? ?
raw('∞') : pool.statistics[:available_quota]
> --
> 1.7.7.6
I think Scott's just-ACKed patch for 784108 changes what we need to do
here. There's now an :instances_failed_visible_count key, as well as
:instances_failed_count, so we can use that now.
-- Matt
Actually this gets at the problem discussed in my patch review. With the
aggregate counts, there's really a case to be made for either set of
numbers -- overall usage stats for a pool are relevant even for users
that don't have permission to access every instance (quota usage,
general notion of failure rates, etc). This is why I didn't just change
instances_failed to use the filtered number. The only place I'm using
instances_failed_visible_count is in the 'alerts' section, since that
section was using instances_failed to determine 1) whether to show
alerts and 2) to indicate the number of alerts. So now the alerts # UI
uses instances_failed_visible_count to show how many, but the overall
pool stats are still using the aggregate numbers.
For the next UX round we should probably come up with a way to show two
sets of numbers -- overall totals, and the subset that concerns
instances visible to the current user.
Scott