Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Add profiling info to development_guide #1674

Merged
merged 1 commit into from
Sep 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion docs/development_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,27 @@ which tests the functionality of multiple functions together. In this particular
- [creates a ConfigMap](https://github.com/openservicemesh/osm/blob/release-v0.2/pkg/configurator/client_test.go#L32)
- [tests whether](https://github.com/openservicemesh/osm/blob/release-v0.2/pkg/configurator/client_test.go#L95-L96) the underlying functions compose correctly by fetching the results of the top-level function `GetMeshCIDRRanges()`


#### Simulation / Demo
When we want to ensure that the entire system works correctly over time and
transitions state as expected - we run
[the demo included in the docs](https://github.com/openservicemesh/osm/blob/main/docs/example/README.md).
This type of test is the slowest, but also most comprehensive. This test will ensure that your changes
work with a real Kubernetes cluster, with real SMI policy, and real functions - no mocked or fake Go objects.

#### Profiling
OSM control plane exposes an HTTP server able to serve a number of resources.

For mesh visibility and debugabbility, one can refer to the endpoints provided under [pkg/debugger](https://github.com/openservicemesh/osm/tree/main/pkg/debugger) which contains a number of endpoints able to inspect and list most of the common structures used by the control plane at runtime.

Additionally, OSM imports and hooks [pprof endpoints](https://golang.org/pkg/net/http/pprof/). Pprof is a golang package able to provide profiling information at runtime through HTTP protocol to a connecting client.

Example usage:
```
scripts/port-forward-osm-debug.sh &
go tool pprof http://localhost:9091/debug/pprof/heap
```
From pprof tool, it is possible to extract a large variety of profiling information, from heap and cpu profiling, to goroutine blocking, mutex profiling or execution tracing. We suggest to refer to their [original documentation](https://golang.org/pkg/net/http/pprof/) for more information.

## Helm charts

The Open Service Mesh control plane chart is located in the
Expand Down