-
Notifications
You must be signed in to change notification settings - Fork 20
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
docs: add Developer document for Performance Profiling in zot #128
Conversation
docs/developer-guide/pprofiling.md
Outdated
|
||
/v2/_zot/pprof/ | ||
|
||
> :pencil2: You must be authenticated to access `/v2/` API commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> :pencil2: You must be authenticated to access `/v2/` API commands. | |
> :pencil2: If you have authentication enabled, only an admin user can access this API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: "If authentication is enabled, only an admin user can access this API."
docs/developer-guide/pprofiling.md
Outdated
|
||
!!! note "Documentation comments" | ||
|
||
Is this section helpful? Need a more interesting illustration (maybe Flame?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a more typical example, if possible.
docs/developer-guide/pprofiling.md
Outdated
|
||
> :point_right: Use zot's built-in profiling tools to collect and analyze runtime performance. | ||
|
||
The profiling capabilities within zot allow a zot administrator to collect and export a range of diagnostic performance data such as CPU intensive function calls, memory allocations, and execution traces. The collected data can then be analyzed using go tools and a variety of available visualization tools. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would add a link from "administrator" to authN/authZ content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: "...allow a zot administrator to collect..."
Put profiling document under "Articles" and cross-ref from admin guide (since admin creds/authZ) and developer guide. |
docs/developer-guide/pprofiling.md
Outdated
|
||
To collect and export any available profile, use the following API command format: | ||
|
||
/v2/_zot/pprof/<profile-name>[?<query-parameters>] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<profile-type>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to "Articles" and added cross-ref links from other guides.
docs/developer-guide/pprofiling.md
Outdated
/v2/_zot/pprof/ | ||
|
||
> :pencil2: If authentication is enabled, only an admin user can access this API. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supported Profile Types
zot
incorporates golang`s pprof package and therefore the following profile types are supported.
profile
heap
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are listed in the previous section "## What data is available?". I added the golang pprof link to that section.
docs/developer-guide/pprofiling.md
Outdated
|
||
/v2/_zot/pprof/<profile-name>[?<query-parameters>] | ||
|
||
The following example shows an API request for the CPU usage profile named `profile` using a collection window of 10 seconds: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... assuming zot
is running at localhost:8080
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at top of this article ...
unless specified, the examples and code snippets in this article assume zot running at localhost:8080
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added note in the top section: "All examples in this article assume that the zot registry is running at localhost:8080
."
docs/developer-guide/pprofiling.md
Outdated
|
||
The following example shows an API request for the CPU usage profile named `profile` using a collection window of 10 seconds: | ||
|
||
$ curl -s -v http://localhost:8080/v2/_zot/pprof/profile?seconds=10 > cpu10.prof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the -v and all the curl logs below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" > cpu.prof"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes made.
docs/developer-guide/pprofiling.md
Outdated
{ [107 bytes data] | ||
* Connection #0 to host localhost left intact | ||
|
||
This command creates an output data file named "cpu10.prof". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cpu.prof"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/developer-guide/pprofiling.md
Outdated
|
||
The pprof package can generate graphic representations of profile data in many formats. This example generates a GIF file representing the CPU usage in the "cpu10.prof" file. | ||
|
||
$ go tool pprof -gif cpu10.prof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cpu.prof"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/developer-guide/pprofiling.md
Outdated
|
||
You can collect trace data with the `trace` profile, as in this example: | ||
|
||
$ curl -s -v http://localhost:8080/v2/_zot/pprof/trace?seconds=10 > trace10.prof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"trace.prof"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also standardize "seconds=30"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
mkdocs.yml
Outdated
@@ -110,6 +110,7 @@ nav: | |||
- Developer Guide: | |||
- Onboarding: developer-guide/onboarding.md | |||
- Extensions: developer-guide/extensions-dev.md | |||
- Performance Profiling: developer-guide/pprofiling.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this under Articles and xref.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
docs/developer-guide/pprofiling.md
Outdated
@@ -0,0 +1,146 @@ | |||
# Performance Profiling in zot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of assets/profile001.gif
Convert this into jpg or png
Rename this file and profiling-001.png
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename assets/images/flame.svg and profiling-flame.svg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: mbshields <[email protected]>
Signed-off-by: mbshields <[email protected]>
Signed-off-by: mbshields <[email protected]>
Signed-off-by: mbshields <[email protected]>
Signed-off-by: mbshields <[email protected]>
Signed-off-by: mbshields <[email protected]>
d01c51c
to
681f687
Compare
@@ -52,6 +52,14 @@ | |||
|
|||
- You can adjust the background scheduler based on your deployment requirements for tasks that are handled in the background, such as garbage collection. See [Configuring zot](../admin-guide/admin-configuration.md). | |||
|
|||
### Performance profiling for troubleshooting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing copied twice here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: mbshields <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
What type of PR is this?
documentation
Which issue does this PR fix:
[Feat]: Include a profiling article in the docs
127
What does this PR do / Why do we need it:
explains to developers how to make use of the performance profiling feature in zot
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.