Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix alignment issue in mc ping. #4218

Merged
merged 8 commits into from
Sep 7, 2022
Merged

Conversation

sinhaashish
Copy link
Contributor

@sinhaashish sinhaashish commented Aug 24, 2022

The mc ping out was mis-aligned .
In order to have a proper alignment , i ave fixed the size of each colums as below
the size of min , max , average is fixed of 8 length, while counter and error are of 3 lengths.

the o/p looks like

ashish@ashish:~/code/go/src/github/minio/mc$ ./mc ping play
  1: https://play.min.io:443   min=3.45s      max=3.45s      average=3.45s      errors=0     roundtrip=3.45s
  2: https://play.min.io:443   min=363.34ms   max=3.45s      average=1.90s      errors=0     roundtrip=363.34ms
  3: https://play.min.io:443   min=301.88ms   max=3.45s      average=1.37s      errors=0     roundtrip=301.88ms
  4: https://play.min.io:443   min=301.88ms   max=3.45s      average=1.11s      errors=0     roundtrip=322.43ms
  5: https://play.min.io:443   min=277.85ms   max=3.45s      average=942.13ms   errors=0     roundtrip=277.85ms
  6: https://play.min.io:443   min=277.85ms   max=3.45s      average=861.73ms   errors=0     roundtrip=459.71ms
  7: https://play.min.io:443   min=275.79ms   max=3.45s      average=778.03ms   errors=0     roundtrip=275.79ms
  8: https://play.min.io:443   min=275.79ms   max=3.45s      average=725.44ms   errors=0     roundtrip=357.32ms
  9: https://play.min.io:443   min=275.79ms   max=3.45s      average=676.34ms   errors=0     roundtrip=283.59ms
 10: https://play.min.io:443   min=275.79ms   max=3.45s      average=636.37ms   errors=0     roundtrip=276.60ms
 11: https://play.min.io:443   min=275.79ms   max=3.45s      average=657.86ms   errors=0     roundtrip=872.77ms
 12: https://play.min.io:443   min=275.79ms   max=3.45s      average=663.11ms   errors=0     roundtrip=720.81ms

@harshavardhana @donatello : please suggest any better approach, if any

@donatello
Copy link
Member

It might be easier to do this alignment dynamically using lipgloss using JoinHorizontal

@sinhaashish
Copy link
Contributor Author

sinhaashish commented Aug 26, 2022

It might be easier to do this alignment dynamically using lipgloss using JoinHorizontal

@donatello JoinHorizontal didn't worked. The present approach will work for second and milliseconds. It pads white space . IMO this is a good approach . It solves the alignment problem.

@sinhaashish
Copy link
Contributor Author

@donatello @kannappanr PTAL

@kannappanr
Copy link
Collaborator

  1: https://play.min.io:443   min=898.97ms   max=898.97ms   average=898.97ms   errors=0   roundtrip=898.97ms
  2: https://play.min.io:443   min=220.85ms   max=898.97ms   average=559.91ms   errors=0   roundtrip=220.85ms

Alignment looks fine. Why is the port displayed here?

@kannappanr
Copy link
Collaborator

Debug option is crashing the binary

Copy link
Member

@donatello donatello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix conflicts

cmd/ping.go Show resolved Hide resolved
@sinhaashish
Copy link
Contributor Author

Debug option is crashing the binary

The debug is crashing because the madmin-go alive function is replying with a -ve response time in debug mode .

{Endpoint:https://play.min.io/ ResponseTime:-3.882013ms DNSResolveTime:4.088693ms Online:true Error:<nil>}

This might be beacuse of time being set in ClientTrace . Need more investigate on this

@vadmeste
Copy link
Member

vadmeste commented Sep 7, 2022

@sinhaashish can you also add DNS output ?

@sinhaashish
Copy link
Contributor Author

@sinhaashish can you also add DNS output ?

DNS output is present in json mode. Since the DNS output has the value only once and 0 all other time , It didn't made any sense to display it in normal mode. Moreover the present op was discussed with AB , and DNS was not a part of it.

Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harshavardhana harshavardhana merged commit f73e036 into minio:master Sep 7, 2022
@sinhaashish sinhaashish deleted the align branch September 8, 2022 03:49
adfost pushed a commit to adfost/mc that referenced this pull request Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants