evidence 0.0.3 → 0.0.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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTRlNjExNTY0MjllNzYwNjZkZTgyYTA0MGIwN2I3MzcxZDBhYjA3NA==
5
+ data.tar.gz: !binary |-
6
+ YjI4MzM1MjQwMzZlYjhiZThjYjhiNGZjNGMyYTU3ZmQ0MjliZTJiYw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ M2MyMjY3Y2U3Y2IxODRiM2M2NzczODdjYzAxYThiODUwNjNlNDNhZTEyNzUz
10
+ MjIyMjg0MGMyMTVmZDA1ZDRlNDQ5MDAyOTczMzFjYjU0OTBlMDBmYWE0NWU1
11
+ ZmE1YWU4MDllYWZmODAxYTUyMzIxMGIwZWIzNDc5NDkzZTQ5ZGE=
12
+ data.tar.gz: !binary |-
13
+ Y2Q1MWQwMmIwZjRlMjU3MzQyNTZjYzNjMGQ3NjAwZTAxZGNhNjYxMWYzNjI3
14
+ MWUxOTdlYTQxM2FmMjg3NTVjY2Y0NGNjOTVhM2FjMjU5OTQ3MjRjZGU0Yzg4
15
+ NzgwNjJlNjAzOGNkMmFjMTdhOWIwNmM5Zjk5Y2EzNGJmNzg0MjE=
@@ -134,7 +134,7 @@ module Evidence
134
134
  end
135
135
  end
136
136
  @slice_start_index, @slice_end_index = range.max, @end_index[range.max]
137
- output[range, EnumStream.new(slice_enum)]
137
+ output[range: range, stream: EnumStream.new(slice_enum)]
138
138
  end
139
139
  end
140
140
  end
data/lib/evidence.rb CHANGED
@@ -32,15 +32,15 @@ module Evidence
32
32
  # log stream | rails_action_parser(pid, message) | request_timestamp_parser | slice_stream(lambda {|action| action[:request][:timestamp]}, 60) | littles_law_analysis
33
33
  def littles_law_analysis
34
34
  lambda do |output|
35
- lambda do |range, actions|
36
- statistics = actions.inject(sum: 0, count: 0) do |memo, action|
35
+ lambda do |actions|
36
+ statistics = actions[:stream].inject(sum: 0, count: 0) do |memo, action|
37
37
  memo[:count] += 1
38
38
  memo[:sum] += action[:response][:completed_time].to_i
39
39
  memo
40
40
  end
41
- avg_sec_arrival_rate = statistics[:count].to_f/(range.max - range.min)
41
+ avg_sec_arrival_rate = statistics[:count].to_f/(actions[:range].max - actions[:range].min)
42
42
  avg_sec_response_time = statistics[:sum].to_f / statistics[:count] /1000
43
- output[range, avg_sec_arrival_rate * avg_sec_response_time]
43
+ output[range: actions[:range], value: avg_sec_arrival_rate * avg_sec_response_time]
44
44
  end
45
45
  end
46
46
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evidence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Xiao Li
@@ -15,7 +14,6 @@ dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rake
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ! '>='
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ! '>='
29
26
  - !ruby/object:Gem::Version
@@ -45,26 +42,25 @@ files:
45
42
  homepage: https://github.com/ThoughtWorksStudios/evidence
46
43
  licenses:
47
44
  - MIT
45
+ metadata: {}
48
46
  post_install_message:
49
47
  rdoc_options: []
50
48
  require_paths:
51
49
  - lib
52
50
  required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
51
  requirements:
55
52
  - - ! '>='
56
53
  - !ruby/object:Gem::Version
57
54
  version: '0'
58
55
  required_rubygems_version: !ruby/object:Gem::Requirement
59
- none: false
60
56
  requirements:
61
57
  - - ! '>='
62
58
  - !ruby/object:Gem::Version
63
59
  version: '0'
64
60
  requirements: []
65
61
  rubyforge_project:
66
- rubygems_version: 1.8.23
62
+ rubygems_version: 2.0.6
67
63
  signing_key:
68
- specification_version: 3
64
+ specification_version: 4
69
65
  summary: Log Analysis Tool
70
66
  test_files: []