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

feat: add a flag to profile the heap memory #1167

Merged

Conversation

HarikrishnanBalagopal
Copy link
Contributor

@HarikrishnanBalagopal HarikrishnanBalagopal commented Mar 26, 2024

$ move2kube help transform
Transform artifacts using move2kube plan

Usage:
  move2kube transform [flags]

Flags:
...................
      --profile string                Path where the CPU profile file should be generated. By default we don't profile.
      --profile-interval-ms int       Time (in milliseconds) between samples of the heap memory profile. Default 500ms. This flag is only used if the --profile-type flag is set to 'heap'. (default 500)
      --profile-type string           The type of profiling that should be performed. Valid values are 'cpu' and 'heap' (Default 'cpu'). This flag is only used if the --profile flag is also provided. (default "cpu")
...................


$ move2kube transform -s language-platforms/ --profile m2kmem --profile-type heap --profile-interval-ms 250 --qa-skip
INFO[0000] Starting Heap Memory profiling (profile every 250 milliseconds) 
INFO[0000] No plan file found.                          
INFO[0000] Using the default QA mappings file           
INFO[0000] Configuration loading done                   
INFO[0000] Start planning                               
INFO[0000] Planning started on the base directory: '/Users/haribala/Desktop/runs/inputs/temp/language-platforms' 
INFO[0000] [ComposeAnalyser] Planning                   
INFO[0000] [ComposeAnalyser] Done                       
INFO[0000] [DockerfileDetector] Planning                
INFO[0000] [DockerfileDetector] Done                    
$ ls
language-platforms	m2k-graph.json		m2kconfig.yaml		m2kmem			m2kqacache.yaml		myproject
$ ls m2kmem/
mem-1	mem-10	mem-2	mem-3	mem-4	mem-5	mem-6	mem-7	mem-8	mem-9
$ go tool pprof -svg -output m2kmem/mem-10.svg m2kmem/mem-10
Generating report in m2kmem/mem-10.svg
image

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the feat label Mar 26, 2024
@HarikrishnanBalagopal HarikrishnanBalagopal merged commit 23226be into konveyor:main Mar 26, 2024
9 checks passed
@HarikrishnanBalagopal HarikrishnanBalagopal deleted the feat/memprofile branch March 26, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants