[v3] knotty: improve the UI information

Message ID 20220127205138.29159-1-twoerner@gmail.com
State New
Headers show
Series [v3] knotty: improve the UI information | expand

Commit Message

Trevor Woerner Jan. 27, 2022, 8:51 p.m. UTC
During a build you might end up with bitbake telling you:

	Currently 30 running tasks (2757 of 2757/3476 of 6390)

Which, to me, is really confusing. The forward slash separator and the two
numbers immediately on each side of which are likely to be interpreted as
being one unit (i.e. 2757/3476) but they're not. Also nothing is labeled,
leaving the user to wonder what these numbers are.

Add labels, spaces, etc. to help clarify the information bitbake is trying to
convey. The resulting line would appear as:

	30 running tasks (setscene:2757/2757 tasks:3476/6390)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes since v2:
- update the "No currently running tasks" message to "No running tasks"
  (i.e. remove the word "currently") for consistency
- remove the double space between the two sets of values

changes since v1:
- improve the commit message
- remove the redundant word "Currently" in order to help keep the total
  line length manageable for users of 80-column terminals
---
 lib/bb/ui/knotty.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Richard Purdie Feb. 1, 2022, 8 a.m. UTC | #1
On Thu, 2022-01-27 at 15:51 -0500, Trevor Woerner wrote:
> During a build you might end up with bitbake telling you:
> 
> 	Currently 30 running tasks (2757 of 2757/3476 of 6390)
> 
> Which, to me, is really confusing. The forward slash separator and the two
> numbers immediately on each side of which are likely to be interpreted as
> being one unit (i.e. 2757/3476) but they're not. Also nothing is labeled,
> leaving the user to wonder what these numbers are.
> 
> Add labels, spaces, etc. to help clarify the information bitbake is trying to
> convey. The resulting line would appear as:
> 
> 	30 running tasks (setscene:2757/2757 tasks:3476/6390)

I agree we shouldn't have used / as a separator, my fault on that.

If we're going to change this again we need to get it right and I feel we're not
quite there yet. I was wondering about:

  30 running tasks (3476 of 6390), (Setscene: 2757 of 2757)

which moves the "tasks" closer together however my other worry is that people
don't know what setscene tasks are and that the setscene piece is then not
ordered before tasks. The "of" keyword does clearly indicate something to some
subgroup of users, I think I was once advised about that.

We could consider:

  Setscene tasks: 2757 of 2757
  30 running tasks: 3476 of 6390 

which would break the code assumptions about a single line but we can likely fix
that...

Cheers,

Richard
Michael Opdenacker Feb. 1, 2022, 2:17 p.m. UTC | #2
Hi Richard,

On 2/1/22 09:00, Richard Purdie wrote:
> On Thu, 2022-01-27 at 15:51 -0500, Trevor Woerner wrote:
>> During a build you might end up with bitbake telling you:
>>
>> 	Currently 30 running tasks (2757 of 2757/3476 of 6390)
>>
>> Which, to me, is really confusing. The forward slash separator and the two
>> numbers immediately on each side of which are likely to be interpreted as
>> being one unit (i.e. 2757/3476) but they're not. Also nothing is labeled,
>> leaving the user to wonder what these numbers are.
>>
>> Add labels, spaces, etc. to help clarify the information bitbake is trying to
>> convey. The resulting line would appear as:
>>
>> 	30 running tasks (setscene:2757/2757 tasks:3476/6390)
> I agree we shouldn't have used / as a separator, my fault on that.
>
> If we're going to change this again we need to get it right and I feel we're not
> quite there yet. I was wondering about:
>
>   30 running tasks (3476 of 6390), (Setscene: 2757 of 2757)


I agree that this would be an improvement.

>
> which moves the "tasks" closer together however my other worry is that people
> don't know what setscene tasks are and that the setscene piece is then not
> ordered before tasks. 


Yes, this could be confusing for people who don't know what setscene
tasks are.

> The "of" keyword does clearly indicate something to some
> subgroup of users, I think I was once advised about that.
>
> We could consider:
>
>   Setscene tasks: 2757 of 2757
>   30 running tasks: 3476 of 6390 
>
> which would break the code assumptions about a single line but we can likely fix
> that...


This would be much clearer indeed. I vote for this solution.
Just my 2 cents.
Cheers
Michael.
Peter Kjellerstedt Feb. 2, 2022, 2:17 a.m. UTC | #3
> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Michael Opdenacker via lists.openembedded.org
> Sent: den 1 februari 2022 15:17
> To: Richard Purdie <richard.purdie@linuxfoundation.org>; Trevor Woerner <twoerner@gmail.com>; bitbake-devel@lists.openembedded.org
> Subject: Re: [bitbake-devel] [PATCH v3] knotty: improve the UI information
> 
> Hi Richard,
> 
> On 2/1/22 09:00, Richard Purdie wrote:
> > On Thu, 2022-01-27 at 15:51 -0500, Trevor Woerner wrote:
> >> During a build you might end up with bitbake telling you:
> >>
> >> 	Currently 30 running tasks (2757 of 2757/3476 of 6390)
> >>
> >> Which, to me, is really confusing. The forward slash separator and the two
> >> numbers immediately on each side of which are likely to be interpreted as
> >> being one unit (i.e. 2757/3476) but they're not. Also nothing is labeled,
> >> leaving the user to wonder what these numbers are.
> >>
> >> Add labels, spaces, etc. to help clarify the information bitbake is trying to
> >> convey. The resulting line would appear as:
> >>
> >> 	30 running tasks (setscene:2757/2757 tasks:3476/6390)
> > I agree we shouldn't have used / as a separator, my fault on that.
> >
> > If we're going to change this again we need to get it right and I feel we're not
> > quite there yet. I was wondering about:
> >
> >   30 running tasks (3476 of 6390), (Setscene: 2757 of 2757)
> 
> I agree that this would be an improvement.
> 
> > which moves the "tasks" closer together however my other worry is that people
> > don't know what setscene tasks are and that the setscene piece is then not
> > ordered before tasks.
> 
> Yes, this could be confusing for people who don't know what setscene
> tasks are.

I am not sure that actually matters that much. My guess is that to many 
people running bitbake, it is doing black magic. And none of the numbers 
really mean anything to them. As long as the numbers keep increasing, and 
the build finishes when they reach max, they will be happy.

> > The "of" keyword does clearly indicate something to some
> > subgroup of users, I think I was once advised about that.

I cannot really see why:

30 running tasks (3476/6390), (Setscene: 2757/2757)

would be harder to understand than:

30 running tasks (3476 of 6390), (Setscene: 2757 of 2757)

but with this formatting, either variant is fine to me.

> > We could consider:
> >
> >   Setscene tasks: 2757 of 2757
> >   30 running tasks: 3476 of 6390
> >
> > which would break the code assumptions about a single line but we can likely fix
> > that...
> 
> This would be much clearer indeed. I vote for this solution.
> Just my 2 cents.

I don't see any real benefit in splitting the line in two, to be honest. 
It just sounds like a lot of work for very little gain.

> Cheers
> Michael.

//Peter

Patch

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 484545a6..2404d996 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -276,11 +276,11 @@  class TerminalFilter(object):
             print(content)
         else:
             if self.quiet:
-                content = "Running tasks (%s of %s/%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
+                content = "Running tasks (setscene:%s/%s tasks:%s/%s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
             elif not len(activetasks):
-                content = "No currently running tasks (%s of %s/%s of %s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
+                content = "No running tasks (setscene:%s/%s tasks:%s/%s)" % (self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
             else:
-                content = "Currently %2s running tasks (%s of %s/%s of %s)" % (len(activetasks), self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
+                content = "%2s running tasks (setscene:%s/%s tasks:%s/%s)" % (len(activetasks), self.helper.setscene_current, self.helper.setscene_total, self.helper.tasknumber_current, self.helper.tasknumber_total)
             maxtask = self.helper.tasknumber_total
             if not self.main_progress or self.main_progress.maxval != maxtask:
                 widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]