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

Make use of ruby-pcp-client 0.2.0 #339

Merged
merged 3 commits into from
Feb 18, 2016

Conversation

richardc
Copy link
Contributor

Make use of the (not yet released) 0.2.0 feature of PCP::SimpleLogger so we can inspect the state of the client object should it not be connected and give more context as to why the connection failed.

Here we bump the dependency on pcp-client gem to 0.2.0 so we can some of the
fixes that should make connection errors more diagnosable.
We can tell quite an amount about why the client failed to connect
if we inspect it and look at its instance variables and the instance
variables of the wrapped websockets connection object.
By using PCP::SimpleLogger the later .inspect of the failed
client state will include the logged lines about why it failed to
connect, something like:

    <PCP::Client:0x007fc8b52defd0
    @logger=#<PCP::SimpleLogger:0x007fc8b52df0e8
        @events=[
           {:when=>1455722334.0191228, :severity=>0, :message=>[:connect, "wss://localhost:8142/pcp"]},
           {:when=>1455722334.019747, :severity=>1, :message=>[:close, 1006, ""]}], @Level=0>
     ...>
@richardc richardc changed the title WIP Make use of ruby-pcp-client 0.2.0 Make use of ruby-pcp-client 0.2.0 Feb 18, 2016
james-stocks pushed a commit that referenced this pull request Feb 18, 2016
Make use of ruby-pcp-client 0.2.0
@james-stocks james-stocks merged commit c745e9d into puppetlabs:stable Feb 18, 2016
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.

2 participants