troycomi / reportseff

Tabular seff
MIT License
71 stars 10 forks source link

Time efficiency values below 10% not right-justified #49

Closed tardigradus closed 3 months ago

tardigradus commented 1 year ago

The time efficiency values are right-justified except when the value has a single digit before the decimal point:

     JobID    State       Elapsed  TimeEff   CPUEff   MemEff 
  15044636   FAILED      00:00:02   0.7%      3.1%     0.9%  
  15045657   FAILED      00:00:02   0.7%      ---      0.9%  
  15048571   FAILED      00:00:17   5.7%      0.4%     4.4%  
  15051923   TIMEOUT     04:00:21  100.1%    99.3%    82.1%  
  15051924   TIMEOUT     04:00:15  100.1%    99.3%    84.6%  
  ...
  15068275  COMPLETED    00:35:50   14.9%    99.1%    82.1%  
  15068276  COMPLETED    01:24:44   35.3%    99.3%    89.8%  

Shouldn't all the values be right-justified?

I would also marginally prefer the states to be left-justified, but that's less of an issue.

troycomi commented 1 year ago

Very observant!

The efficiency columns are centered by default. TimeEff is slightly different because the size of the column is 7 characters instead of 6 for say CPUEff. I'm inclined to say I won't fix but given the static nature, and importance, of those columns I may reconsider.

However, you can change the output format however you please. As an alias:

alias rs='reportseff --format "JobID%>,State%<,Elapsed%>,TimeEff%>,CPUEff%>,MemEff%>"'
tardigradus commented 1 year ago

Sorry, I didn't read the documentation carefully enough and didn't spot --format. I almost wrote that it would be nice to be able to configure the output, so it's great that one already can.