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

Slate 1.1.1 does not support multiple targets #7

Open
aselder opened this issue Mar 20, 2014 · 7 comments
Open

Slate 1.1.1 does not support multiple targets #7

aselder opened this issue Mar 20, 2014 · 7 comments

Comments

@aselder
Copy link

aselder commented Mar 20, 2014

slate = Slate.configure do |config|
  config.endpoint = "http://10.6.199.66:443"
end

graph = Slate::Graph.new(slate)
graph << Slate::Target.build("stats.gauges.importer.goal.30_minutes")
graph << Slate::Target.build("stats.gauges.importer.success.30_minutes")
graph.from = from_date

data = JSON.parse(graph.download(:json))

putting a 'ap' inside Faraday reveals the following request object:

{
:body => nil,
:path => "http://10.6.199.66:443/render",
:method => :get,
:headers => {
"User-Agent" => "Faraday v0.8.9"
},
:params => {
"target" => "stats.gauges.importer.success.30_minutes",
"format" => "json"
},
:options => {
:timeout => 10,
:proxy => nil
}
}

Faraday is only taking the last value of the target param.

@trobrock
Copy link
Owner

@aselder
Copy link
Author

aselder commented Mar 20, 2014

That url then get munged by Faraday and the first target gets dropped

@trobrock
Copy link
Owner

Ahh. I will take a look then.

On Thu, Mar 20, 2014 at 4:14 PM, aselder [email protected] wrote:

That url then get munged by Faraday and the first target gets dropped

Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-38232461
.

Thanks,
Trae Robrock
http://about.me/trobrock

@aselder
Copy link
Author

aselder commented Mar 20, 2014

1.8.7-p371 :006 > f = Faraday.new
=> #<Faraday::Connection:0x116c5a780 @headers={"User-Agent"=>"Faraday v0.8.9"}, @Proxy=nil, @ssl={}, @builder=#<Faraday::Builder:0x116c5a5f0 @handlers=[Faraday::Request::UrlEncoded, Faraday::Adapter::NetHttp]>, @params={}, @default_parallel_manager=nil, @options={}, @parallel_manager=nil, @url_prefix=#<URI::HTTP:0x116c59da8 URL:http:/>>
1.8.7-p371 :007 > uri = f.build_url("http://10.6.199.66:443/render?target=stats.gauges.importer.goal.30_minutes&target=stats.gauges.importer.success.30_minutes&from=20140313&format=png")
=> #<URI::HTTP:0x116c3bc18 URL:http://10.6.199.66:443/render?format=png&from=20140313&target=stats.gauges.importer.success.30_minutes>
1.8.7-p371 :009 > uri.to_s
=> "http://10.6.199.66:443/render?format=png&from=20140313&target=stats.gauges.importer.success.30_minutes"

@trobrock
Copy link
Owner

Thats nice of faraday

@aselder
Copy link
Author

aselder commented Mar 20, 2014

lostisland/faraday#182

@aselder
Copy link
Author

aselder commented Mar 20, 2014

Yeah, I thought so

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

No branches or pull requests

2 participants