fiveruns-dash-ruby 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ module Fiveruns::JSON
2
+ VERSION = '1.1.3'
3
+ VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
4
+ VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
5
+ VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
6
+ VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
7
+ VARIANT_BINARY = false
8
+ end
@@ -37,7 +37,7 @@ module Fiveruns::Dash::Store::HTTP
37
37
  Fiveruns::Dash.logger.debug "Received unknown response from Dash service (#{response.inspect})"
38
38
  false
39
39
  end
40
- rescue JSON::ParserError => e
40
+ rescue ::Fiveruns::JSON::ParserError => e
41
41
  puts response.body
42
42
  Fiveruns::Dash.logger.error "Received non-JSON response (#{response.inspect})"
43
43
  false
Binary file
data/test/json_test.rb ADDED
@@ -0,0 +1,33 @@
1
+ require File.dirname(__FILE__) << "/test_helper"
2
+ require 'zlib'
3
+
4
+ class JsonTest < Test::Unit::TestCase
5
+
6
+ def profile(name, &block)
7
+ require 'ruby-prof'
8
+ result = RubyProf.profile(&block)
9
+ printer = RubyProf::GraphHtmlPrinter.new(result)
10
+ File.open("#{name}.html", 'w') do |f|
11
+ printer.print(f, :min_percent=>1)
12
+ end
13
+ end
14
+
15
+ def xprofile(name, &block)
16
+ block.call
17
+ end
18
+
19
+ def setup
20
+ File.open("#{File.dirname(__FILE__)}/data_payload.bin.gz") do |f|
21
+ @data = eval(Zlib::GzipReader.new(f).read)
22
+ end
23
+ end
24
+
25
+ def test_serialization
26
+ xprofile('fjson') do
27
+ @data.to_fjson
28
+ end
29
+ a = Time.now
30
+ fjson = @data.to_fjson
31
+ # puts "FJSON: #{Time.now - a}"
32
+ end
33
+ end
data/version.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 8
4
- :patch: 3
4
+ :patch: 4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiveruns-dash-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - FiveRuns Development Team
@@ -9,19 +9,10 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-26 00:00:00 -08:00
12
+ date: 2009-03-04 00:00:00 -08:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: json
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
14
+ dependencies: []
15
+
25
16
  description: Provides an API to send metrics to the FiveRuns Dash service
26
17
  email: dev@fiveruns.com
27
18
  executables: []
@@ -55,14 +46,25 @@ files:
55
46
  - lib/fiveruns/dash/util.rb
56
47
  - lib/fiveruns/dash/version.rb
57
48
  - lib/fiveruns/dash.rb
49
+ - lib/fiveruns/json
50
+ - lib/fiveruns/json/add
51
+ - lib/fiveruns/json/add/core.rb
52
+ - lib/fiveruns/json/add/rails.rb
53
+ - lib/fiveruns/json/common.rb
54
+ - lib/fiveruns/json/generator.rb
55
+ - lib/fiveruns/json/pure.rb
56
+ - lib/fiveruns/json/version.rb
57
+ - lib/fiveruns/json.rb
58
58
  - test/collector_communication_test.rb
59
59
  - test/configuration_test.rb
60
+ - test/data_payload.bin.gz
60
61
  - test/exception_recorder_test.rb
61
62
  - test/file_store_test.rb
62
63
  - test/fixtures
63
64
  - test/fixtures/http_store_test
64
65
  - test/fixtures/http_store_test/response.json
65
66
  - test/http_store_test.rb
67
+ - test/json_test.rb
66
68
  - test/metric_test.rb
67
69
  - test/recipe_test.rb
68
70
  - test/reliability_test.rb