datadog_proxy 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd95785d070357aa71de95aff5d93dbae635f90f
4
- data.tar.gz: 0ca04e042dbd972036f513b3503370fd16965e35
3
+ metadata.gz: e8a042b0c28e403246666581c74f0e884488b574
4
+ data.tar.gz: a4f213d2dc1b0e33b4eb8dec9ef45152fe53c86c
5
5
  SHA512:
6
- metadata.gz: d1a065c366a2c110bf5ad885762933a92db78c3672466c93b4c35d5efb18b2b903b6a7c843b1e450d95b0e45e9118c5b32a62d3fa12f5753b1989d4c5767dbce
7
- data.tar.gz: ef53efb699620d7863568cb01c7b0790908dea76be14d485d748df890acabce8a5a07ede0021665ae44ee209d4210d3cf36c2862ffb9dae99dbea61f93e19517
6
+ metadata.gz: b9a4050cd762f5fcff11b4adace2869b697d1d82b9e3139d5589c47f2f220b023ff6a775f67dd8c81cfde510a7864936858ffaa355cc3425d92ab686eecb8317
7
+ data.tar.gz: 5a6cef66aa85abea02ebc75513621eecf7efbdb2665db0071e717aeea15265796220ecff33c12e7007330a4d8de3691735faa7d9301b0e5005ddaffa704806a1
@@ -28,6 +28,10 @@ module DatadogProxy
28
28
  end
29
29
 
30
30
  get '/graphs/snapshot' do
31
+ if params.empty?
32
+ return erb(:snapshot)
33
+ end
34
+
31
35
  options = {}
32
36
  options[:query] = params[:query]
33
37
  options[:start] = _parse_time(params[:start]) if params[:start]
@@ -1,3 +1,3 @@
1
1
  module DatadogProxy
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -0,0 +1,32 @@
1
+ <html>
2
+ <body>
3
+ <form id="form">
4
+ <input type="text" placeholder="query" name="query" value="system.load.1{*}">
5
+ <input type="text" placeholder="start" name="start">
6
+ <input type="text" placeholder="end" name="end" value="now">
7
+ <input type="text" placeholder="duration" name="duration" value="3600">
8
+ <input type="submit">
9
+ </form>
10
+
11
+ <img id="graph" src="">
12
+
13
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
14
+ <script>
15
+ $(function() {
16
+ $("#form").bind("submit", function() {
17
+ var url = "/graphs/snapshot?";
18
+ var names = ["query", "start", "end", "duration"];
19
+ for (var i = 0; i < names.length; i++) {
20
+ var name = names[i];
21
+ var value = $("#form input[name=" + name + "]").val();
22
+ if (value != "") {
23
+ url += name + "=" + encodeURIComponent(value) + "&";
24
+ }
25
+ }
26
+ $("#graph").attr("src", url);
27
+ return false;
28
+ });
29
+ });
30
+ </script>
31
+ </body>
32
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
@@ -142,6 +142,7 @@ files:
142
142
  - lib/datadog_proxy/app.rb
143
143
  - lib/datadog_proxy/datadog_client.rb
144
144
  - lib/datadog_proxy/version.rb
145
+ - lib/datadog_proxy/views/snapshot.erb
145
146
  - spec/app_spec.rb
146
147
  - spec/spec_helper.rb
147
148
  homepage: https://github.com/ryotarai/datadog_proxy