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

Update client package docs #107

Merged
merged 3 commits into from
Jul 25, 2022

Conversation

srikanthccv
Copy link
Member

Partially addresses #100. Also added to some internal funcs which I thought would be helpful to get a quick summary.

@srikanthccv srikanthccv requested a review from a team July 16, 2022 13:07
@codecov
Copy link

codecov bot commented Jul 16, 2022

Codecov Report

Merging #107 (3d2f632) into main (037ef8a) will increase coverage by 0.46%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
+ Coverage   75.77%   76.24%   +0.46%     
==========================================
  Files          22       22              
  Lines        1577     1633      +56     
==========================================
+ Hits         1195     1245      +50     
- Misses        288      292       +4     
- Partials       94       96       +2     
Impacted Files Coverage Δ
client/httpclient.go 94.54% <ø> (+0.10%) ⬆️
client/internal/clientstate.go 90.47% <ø> (ø)
client/internal/httpsender.go 72.26% <ø> (ø)
client/internal/nextmessage.go 100.00% <ø> (ø)
client/internal/packagessyncer.go 59.25% <ø> (ø)
client/internal/sender.go 86.36% <ø> (ø)
client/internal/wsreceiver.go 91.42% <ø> (ø)
client/internal/wssender.go 90.90% <ø> (ø)
client/types/callbacks.go 66.66% <ø> (ø)
client/wsclient.go 84.56% <ø> (+0.09%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 037ef8a...3d2f632. Read the comment docs.

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

Great comments, thanks a lot. I have just one minor suggestion.

@@ -33,6 +34,7 @@ func NewHTTP(logger types.Logger) *httpClient {
return w
}

// Start starts the client and runs until Stop is called.
Copy link
Member

Choose a reason for hiding this comment

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

Start() is explained in more detail in the OpAMPClient interface description. We can either copy the comment from there or reference from here.

Copy link
Member Author

@srikanthccv srikanthccv Jul 21, 2022

Choose a reason for hiding this comment

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

Right, I wasn't really sure about this. What do you think about remaining ones SetAgentDescription, SetHealth etc..? Should we copy for all of them?

Copy link
Member

Choose a reason for hiding this comment

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

If you can add a reference in a way that it becomes a link in godoc here that would be best, so that we don't have to duplicate the content and risk diverging.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like there is no way to achieve this. I looked up how the packages in stdlib cross reference the functions from other modules. It just uses plain text like os.Exit or json.Marshal for the same reason.

Copy link
Member

Choose a reason for hiding this comment

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

OK, let's just put plain text to reference OpAMPClient.Start.

@@ -39,6 +39,8 @@ type MessageData struct {
}

type Callbacks interface {
// OnConnect is called when the connection is successfully established to the Server.
// May be called after Start() is called and every time connected to the Server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// May be called after Start() is called and every time connected to the Server.
// May be called after Start() is called and every time a connection is established to the Server.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add more description here for websocket and http?

For example:

WebSocket clients will call OnConnect when a new WebSocket connection is established.

HTTP clients will call OnConnect after any request that results in a 200 response.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good suggestion. I will update the description.

srikanthccv and others added 2 commits July 21, 2022 15:19
Co-authored-by: Andy Keller <andykellr@users.noreply.github.com>
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

Thanks @srikanthccv

@tigrannajaryan tigrannajaryan merged commit be3f3ff into open-telemetry:main Jul 25, 2022
@srikanthccv srikanthccv deleted the client-doc-update branch July 26, 2022 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants