Re: [kubernetes/kubernetes] Capture spew.Sprintf() with all our favorite config into a util func (#8976)

0 views
Skip to first unread message

Michail Kargakis

unread,
Jun 9, 2017, 12:58:05 PM6/9/17
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

@kubernetes/sig-api-machinery-misc


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Tim Hockin

unread,
Nov 8, 2017, 11:56:32 PM11/8/17
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Another that might be worth considering is https://github.com/sanity-io/litter - I like that emits Go-style literals. Unclear if that can be compacted into 1 line, if it handles map keys and things as well as spew does.

fejta-bot

unread,
Feb 7, 2018, 2:36:49 PM2/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Tim Hockin

unread,
Feb 7, 2018, 4:50:19 PM2/7/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/lifecycle frozen
/remove-lifecycle stale

mdhedley

unread,
May 1, 2018, 11:22:52 AM5/1/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

It doesn't look like anyone has looked at this recently. Would anyone mind if I took a run at wrapping the suggested sanity-io/litter with the suggested util.PrettyPrintObject(interface{}) as suggested? I'm pretty new to go so this seemed like something I could tackle.

Tim Hockin

unread,
May 15, 2018, 8:36:11 PM5/15/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention
I like litter - give it a shot


On Tue, May 1, 2018 at 8:22 AM mdhedley <notifi...@github.com> wrote:

> It doesn't look like anyone has looked at this recently. Would anyone mind
> if I took a run at wrapping the suggested sanity-io/litter with the
> suggested util.PrettyPrintObject(interface{}) as suggested? I'm pretty new
> to go so this seemed like something I could tackle.
>
> —
> You are receiving this because you authored the thread.

> Reply to this email directly, view it on GitHub
> <https://github.com/kubernetes/kubernetes/issues/8976#issuecomment-385698227>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AFVgVNtMb7Lg1mjN6f-p3lo1hN4Ofdu7ks5tuH20gaJpZM4EuVBn>

k8s-ci-robot

unread,
Sep 13, 2018, 4:50:54 PM9/13/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

@nikhita:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

I'm going to label this a good-first-issue because the changes are relatively easier and there is already a PR (which was closed due to age) that can be used as a reference: #55383

/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Nikhita Raghunath

unread,
Sep 13, 2018, 4:51:32 PM9/13/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

I'm going to label this a good-first-issue because the changes are relatively easier and there is already a PR (which was closed due to age) that can be used as a reference: #55383

/good-first-issue

Nikhita Raghunath

unread,
Sep 13, 2018, 4:59:16 PM9/13/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/kind cleanup

Gokul T P

unread,
Sep 26, 2018, 11:02:02 AM9/26/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

I would like to take this up.
/assign

k8s-ci-robot

unread,
Sep 26, 2018, 11:03:04 AM9/26/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

@gokultp: GitHub didn't allow me to assign the following users: gokultp.

Note that only kubernetes members and repo collaborators can be assigned.
For more information please see the contributor guide

In response to this:

I would like to take this up.
/assign

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Gokul T P

unread,
Sep 30, 2018, 11:41:26 PM9/30/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

I compared the performances of both spew and litter packages. attaching the benchmarks below.

goos: linux
goarch: amd64
pkg: github.com/gokultp/bookmark_pretty_printers
BenchmarkLitter-4   	  300000	      4679 ns/op	    1824 B/op	      79 allocs/op
BenchmarkSpew-4   	  500000	      2668 ns/op	     656 B/op	      26 allocs/op
PASS

clearly spew is performing better than litter, so I am using spew for writing the util function.

Tim Hockin

unread,
Oct 2, 2018, 12:12:06 AM10/2/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention
This is good insight, but raw perf should not be the only metric. We
should evaluate output for human readability.


On Sun, Sep 30, 2018 at 8:40 PM Gokul T P <notifi...@github.com> wrote:

> I compared the performances of both spew and litter packages. attaching
> the benchmarks below.
>
> goos: linux
> goarch: amd64
> pkg: github.com/gokultp/bookmark_pretty_printers
> BenchmarkLitter-4 <http://github.com/gokultp/bookmark_pretty_printersBenchmarkLitter-4> 300000 4679 ns/op 1824 B/op 79 allocs/op

> BenchmarkSpew-4 500000 2668 ns/op 656 B/op 26 allocs/op
> PASS
>
> clearly spew is performing better than litter, so I am using spew for
> writing the util function.
>
> —
> You are receiving this because you authored the thread.

> Reply to this email directly, view it on GitHub
> <https://github.com/kubernetes/kubernetes/issues/8976#issuecomment-425781589>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AFVgVEcdfw5ZqxyahOVkE8C3esC7Sznbks5ugY65gaJpZM4EuVBn>

Tim Hockin

unread,
Oct 2, 2018, 12:13:51 AM10/2/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention
Also there's https://github.com/kr/pretty

Also we should file a bug againstlitter to see if they can do better (I
like their output better than spew)

Gokul T P

unread,
Oct 2, 2018, 10:42:49 PM10/2/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Actually https://github.com/kr/pretty is working well. here is the benchmarks

BenchmarkPretty-4   	  500000	      2653 ns/op	     360 B/op	      14 allocs/op
BenchmarkLitter-4   	  300000	      4717 ns/op	    1824 B/op	      79 allocs/op
BenchmarkSpew-4   	  500000	      2639 ns/op	     656 B/op	      26 allocs/op

also attaching the formatted outputs

  1. spew:
{{foo false 12344} 1234.123 [foo bar]}
  1. linter:
main.TestType{
          Field1: main.SubType{
            Field2: "foo",
            Field3: false,
            Field4: 12344,
          },
          Field5: 1234.123,
          Field6: []string{
            "foo",
            "bar",
          },
        }
  1. pretty :
main.TestType{Field1:main.SubType{Field2:"foo", Field3:false, Field4:12344}, Field5:1234.123, Field6:[]string{"foo", "bar"}}

so I'll be changing the util function to use https://github.com/kr/pretty, as it is giving better performance and almost the same output.

Han Kang

unread,
Oct 29, 2018, 1:33:26 PM10/29/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

I agree that it may not make a lot of sense to actually migrate anything over here. I personally prefer the standard lib output.

Gaurav Walecha

unread,
Jan 30, 2019, 8:32:13 AM1/30/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

It seems like fanzhangio has already resolved the aim of this ticket. What all things are left in this to work ?

Akshesh Doshi

unread,
Mar 11, 2019, 2:47:07 AM3/11/19
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Hi
Can this ticket be marked as closed or is there anything left? I would like to help, if required.

Tim Garrity

unread,
May 13, 2020, 12:11:25 AM5/13/20
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/close


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Kubernetes Prow Robot

unread,
May 13, 2020, 12:11:39 AM5/13/20
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

@Salamandastron1: You can't close an active issue/PR unless you authored it or you are a collaborator.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Jonathan Elroy Alvares

unread,
Apr 18, 2021, 12:39:04 PM4/18/21
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/assign

Jonathan Elroy Alvares

unread,
Apr 18, 2021, 12:40:28 PM4/18/21
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/unassign

Madhvi Patel

unread,
Sep 23, 2021, 9:03:42 AM9/23/21
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Hi,
Is this ticket closed or still open.
I wanted to take this .


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.

shadower

unread,
Oct 26, 2021, 5:08:10 AM10/26/21
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/assign

Yorman

unread,
Dec 15, 2021, 4:45:51 AM12/15/21
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

/close

Kubernetes Prow Robot

unread,
Dec 15, 2021, 4:46:10 AM12/15/21
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

@cixtor: You can't close an active issue/PR unless you authored it or you are a collaborator.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Leo Sorkin

unread,
Feb 11, 2022, 2:02:40 PM2/11/22
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Hi
It looks like this issue now has a separate PR. @thockin could you take a look and see if this is something still viable after 6 years? kubernetes/utils#226


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issues/8976/1036524071@github.com>

Hao Ruan

unread,
Oct 17, 2022, 11:58:00 PM10/17/22
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Based on kubernetes/utils#226 (comment), we decided to work on k/k first, then move to kubernetes/utils @thockin


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issues/8976/1281781983@github.com>

Kubernetes Prow Robot

unread,
Apr 11, 2023, 6:35:14 PM4/11/23
to kubernetes/kubernetes, k8s-mirror-api-machinery-misc, Team mention

Closed #8976 as completed via #114800.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issue/8976/issue_event/8978692564@github.com>

Reply all
Reply to author
Forward
0 new messages