Skip to content

Commit

Permalink
move the example main to seperate folder
Browse files Browse the repository at this point in the history
Signed-off-by: Lance Liu <[email protected]>
  • Loading branch information
Lance Liu committed Jul 24, 2020
1 parent b6a98b0 commit efd847e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"k8s.io/client-go/tools/clientcmd"
"knative.dev/client-contrib/plugins/admin/pkg/command/profiling"
)

// DO NOT COMMIT
Expand Down Expand Up @@ -40,7 +41,7 @@ func main() {
}

podName := pods.Items[0].Name
d, err := NewDownloader(cfg, podName, "knative-serving", end)
d, err := profiling.NewDownloader(cfg, podName, "knative-serving", end)
if err != nil {
log.Fatal(err)
}
Expand All @@ -51,15 +52,15 @@ func main() {
f1, _ := ioutil.TempFile("", "")
defer f1.Close()
log.Println("downloading 5s CPU profile")
err = d.Download(ProfileTypeProfile, f1, ProfilingTime(5*time.Second))
err = d.Download(profiling.ProfileTypeProfile, f1, profiling.ProfilingTime(5*time.Second))
if err != nil {
log.Fatal(err)
}
log.Printf("cpu profile saved to %s", f1.Name())
f2, _ := ioutil.TempFile("", "")
defer f2.Close()
log.Println("downloading heap profile")
err = d.Download(ProfileTypeHeap, f2)
err = d.Download(profiling.ProfileTypeHeap, f2)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit efd847e

Please sign in to comment.