[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: when is a multi-gear application started/stopped?



It would say 3/4 started.  I think we should update the tooltip to include the partial states, just an oversight

There's a bug in the CLI too where it's not totally consistent.  Here's the rough algorithm that the CLI and console *should* be using, if anyone has feedback or suggestions I'm happy to take them:

  // in ruby

  def gear_group_states(string gear_states)
    return states[0].to_s.humanize if states.uniq.length == 1
    "#{states.count{ |s| s == :started }}/#{states.length} started"
  end

  def gear_group_state(states)
    css_class = if states.all? {|s| s == :started}
        'state_started'
      elsif states.none? {|s| s == :started}
        'state_stopped'
      end

    content_tag(:span, gear_group_states(states), :class => css_class)
  end

So roughly, display the number of gears that are in the 'started' state.  If there is only one gear, display the state it is in.  Reasoning behind this is that 'started' state is most important (it's what's running), so this always provides an at a glance at how many gears are running in a compact space.  

Arguably the title attribute here should be a more descriptive list of what is started.

----- Original Message -----
> On 03/06/2013 03:35 PM, Clayton Coleman wrote:
> > The console reports number in the running state, unless all gears
> > are in a different state.
> 
> sounds like as if the Web-UI would report: 3 gears running, 1 gear
> idle?
> 
> >
> > On Mar 6, 2013, at 9:23 AM, André Dietisheim <adietish redhat com>
> > wrote:
> >
> >> Hi
> >>
> >> I am trying to implement states for an application. Afaik the
> >> "gear_groups" resource tells you about the state of the gears an
> >> application is running on. Given an app with a single gear
> >> there's no wondering, but what about a scaling app running on
> >> several gears? Is it possible that the gears are in different
> >> states? What to report in this case?
> >>
> >> Thanks
> >> André
> >>
> >> _______________________________________________
> >> dev mailing list
> >> dev lists openshift redhat com
> >> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
> 
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]