oj 2.18.3 → 2.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- #$VERBOSE = true
5
-
6
- $: << File.dirname(__FILE__)
7
- $: << File.expand_path("../../ext")
8
- $: << File.expand_path("../../lib")
9
- $: << File.expand_path("../../../curb/ext")
10
- $: << File.expand_path("../../../curb/lib")
11
-
12
- require 'curb'
13
- require 'oj'
14
-
15
- $cnt = 0
16
-
17
- $url = "localhost:7660/data.json"
18
-
19
- begin
20
- while true
21
- before = GC.count
22
- curl = Curl::Easy.new($url)
23
- curl.ssl_verify_host = false
24
- curl.http_get
25
- if before != GC.count
26
- puts " did a GC in curl #{GC.count}"
27
- before = GC.count
28
- end
29
- =begin
30
- data = Oj.load(curl.body, symbol_keys: true, mode: :strict)
31
- puts " did a GC in Oj #{GC.count}" if before != GC.count
32
-
33
- if data[:data].nil? or data[:data].any? { |e| e.empty? }
34
- puts "body: #{curl.body}"
35
- raise "FAILED"
36
- end
37
- =end
38
- $cnt += 1
39
- print "\r #{$cnt}"
40
- end
41
- rescue Exception => e
42
- puts "#{e.class}: #{e.message}"
43
- puts "url: #{$url}"
44
- #puts "data: #{data}"
45
- #puts "data[data]: #{data[:data]}"
46
- end
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- $VERBOSE = true
5
-
6
- $: << File.dirname(__FILE__)
7
- $: << File.expand_path("../../ext")
8
- $: << File.expand_path("../../lib")
9
-
10
- require 'net/http'
11
- require 'uri'
12
- require 'oj'
13
-
14
- $url = URI.parse("http://localhost:7660/data.json")
15
-
16
- $cnt = 0
17
-
18
- while true
19
- response = Net::HTTP.get_response($url)
20
- data = Oj.load(response.body, symbol_keys: true, mode: :strict)
21
- raise "FAILED" if data[:data].any? { |e| e.empty? }
22
- $cnt += 1
23
- print "\r #{$cnt}"
24
- end
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- #$VERBOSE = true
5
-
6
- $: << File.dirname(__FILE__)
7
- #$: << File.expand_path("../../../curb/ext")
8
- #$: << File.expand_path("../../../curb/lib")
9
-
10
- require 'curb'
11
-
12
- $cnt = 0
13
- $url = "localhost:7660/data.json"
14
-
15
- begin
16
- while true
17
- before = GC.count
18
- curl = Curl::Easy.new($url)
19
- curl.ssl_verify_host = false
20
- curl.http_get
21
- if before != GC.count
22
- puts " did a GC in curl #{GC.count}"
23
- before = GC.count
24
- end
25
- $cnt += 1
26
- print "\r #{$cnt}"
27
- end
28
- rescue Exception => e
29
- puts "#{e.class}: #{e.message}"
30
- puts "url: #{$url}"
31
- end
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
-
4
- $VERBOSE = true
5
-
6
- $: << File.dirname(__FILE__)
7
- $: << File.expand_path("../../ext")
8
- $: << File.expand_path("../../lib")
9
-
10
- require 'oj'
11
-
12
- $json = %|
13
- {
14
- "data" : [ {
15
- "action" : "login",
16
- "event" : "user",
17
- "field" : "login",
18
- "value" : "foobar",
19
- "info" : "Authenticated \\"Foo Bar\\"",
20
- "id" : "585929918297f2740ed9f5f0",
21
- "_metadata" : {
22
- "version" : "1"
23
- },
24
- "timestamp" : "2016-12-20T07:52:33",
25
- "key_id" : "4"
26
- } ],
27
- "info" : {
28
- "view" : "partial",
29
- "limit" : 500,
30
- "offset" : 2000,
31
- "results" : 500,
32
- "ordering" : "timestamp desc,id",
33
- "previous" : "https://api.server.com/some/path/event?calculate_total=false&draft=base&order_by=timestamp_desc&order_by=id&subdraft=none&offset=1500&limit=500",
34
- "next" : "https://api.server.com/some/path/event?calculate_total=false&draft=base&order_by=timestamp_desc&order_by=id&subdraft=none&offset=2500&limit=500",
35
- "draft" : "base",
36
- "subdraft" : "none",
37
- "total_results" : 100000
38
- }
39
- }
40
- |
41
-
42
- $cnt = 0
43
-
44
- while true
45
- before = GC.count
46
- data = Oj.load($json, symbol_keys: true, mode: :strict)
47
- puts " did a GC in Oj #{GC.count} - #{$cnt}" if before != GC.count
48
- raise "FAILED" if data[:data].any? { |e| e.empty? }
49
- $cnt += 1
50
- print "\r #{$cnt}" if 0 == ($cnt % 10000)
51
- end