Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

add trace profiling #111

Merged
merged 3 commits into from
Oct 10, 2017
Merged

add trace profiling #111

merged 3 commits into from
Oct 10, 2017

Conversation

nkubala
Copy link
Contributor

@nkubala nkubala commented Oct 6, 2017

This will help us profile where the most optimizations can be made in container-diff.

To use, run container-diff with CONTAINER_DIFF_ENABLE_PROFILING=1:

➜  container-diff git:(profile) ✗ CONTAINER_DIFF_ENABLE_PROFILING=1 ./out/container-diff diff gcr.io/google-appengine/python:latest daemon://python_upgrade:latest --types=pip --alsologtostderr -v 10
2017/10/06 12:25:34 profile: trace enabled, /var/folders/sd/6b31fmr96q93wr2y82lqpb0h00cjy3/T/profile223722564/trace.out
I1006 12:25:34.622636    2829 diff.go:81] Starting diff on images gcr.io/google-appengine/python:latest and daemon://python_upgrade:latest, using differs: [pip]
...
...
I1006 12:26:56.573392    2829 image_prep_utils.go:164] Removing image filesystem directory /var/folders/sd/6b31fmr96q93wr2y82lqpb0h00cjy3/T/python_upgradelatest804814547 from system
I1006 12:26:58.455451    2829 image_prep_utils.go:164] Removing image filesystem directory /var/folders/sd/6b31fmr96q93wr2y82lqpb0h00cjy3/T/gcr.iogoogle-appenginepythonlatest496923158 from system
2017/10/06 12:27:00 profile: trace disabled, /var/folders/sd/6b31fmr96q93wr2y82lqpb0h00cjy3/T/profile223722564/trace.out

Then, run go tool trace <path_to_trace>/trace.out.

@nkubala nkubala requested review from r2d4 and dlorenc October 6, 2017 19:32
cmd/analyze.go Outdated
@@ -42,6 +43,9 @@ var analyzeCmd = &cobra.Command{
return nil
},
Run: func(cmd *cobra.Command, args []string) {
if os.Getenv(containerDiffEnvPrefix) == "1" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you put this in main.go instead?

Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

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

.

@nkubala nkubala merged commit 11e9e28 into GoogleContainerTools:master Oct 10, 2017
@nkubala nkubala deleted the profile branch October 10, 2017 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants