wor-prof 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7aafc1b1d9ba458616ea3920f7b5ae91b6848658d9c5c11ea05cabb2807e0a6a
4
+ data.tar.gz: 5befa9862dfbaf39424d533cff8eb7091ffd0e9eb33d45bd4ed06e2370533b6c
5
+ SHA512:
6
+ metadata.gz: 6e30b75c55a2e65c9fed9331a482c1a15630e6a6dc416b7d46c451f7dd653eec63ea33bf56075861d8ca9398fa6b59236e7144288d04aa0dcbde8f00f8c1c6a5
7
+ data.tar.gz: bfe65955e599338e59828ca989e5c033c1a4d620606ae59f845eff8c023e44db98185831746c41037b9532d15da3902368e73bfa06eff966f44acaee9d643561
data/.gitignore ADDED
@@ -0,0 +1,331 @@
1
+ spec/dummy/db/*.sqlite3
2
+ spec/dummy/db/*.sqlite3-journal
3
+ spec/dummy/log/*.log
4
+ spec/dummy/tmp/
5
+
6
+ /.bundle/
7
+ /.yardoc
8
+ /Gemfile.lock
9
+ /_yardoc/
10
+ /coverage/
11
+ /pkg/
12
+ /spec/reports/
13
+ /tmp/
14
+ *.gem
15
+ Gemfile.lock
16
+
17
+ # Created by https://www.gitignore.io/api/ruby,rubymine,rails,emacs,vim,sublimetext,osx,macos,linux,windows
18
+
19
+ ### Emacs ###
20
+ # -*- mode: gitignore; -*-
21
+ *~
22
+ \#*\#
23
+ /.emacs.desktop
24
+ /.emacs.desktop.lock
25
+ *.elc
26
+ auto-save-list
27
+ tramp
28
+ .\#*
29
+
30
+ # Org-mode
31
+ .org-id-locations
32
+ *_archive
33
+
34
+ # flymake-mode
35
+ *_flymake.*
36
+
37
+ # eshell files
38
+ /eshell/history
39
+ /eshell/lastdir
40
+
41
+ # elpa packages
42
+ /elpa/
43
+
44
+ # reftex files
45
+ *.rel
46
+
47
+ # AUCTeX auto folder
48
+ /auto/
49
+
50
+ # cask packages
51
+ .cask/
52
+ dist/
53
+
54
+ # Flycheck
55
+ flycheck_*.el
56
+
57
+ # server auth directory
58
+ /server/
59
+
60
+ # projectiles files
61
+ .projectile
62
+
63
+ # directory configuration
64
+ .dir-locals.el
65
+
66
+ ### Linux ###
67
+
68
+ # temporary files which can be created if a process still has a handle open of a deleted file
69
+ .fuse_hidden*
70
+
71
+ # KDE directory preferences
72
+ .directory
73
+
74
+ # Linux trash folder which might appear on any partition or disk
75
+ .Trash-*
76
+
77
+ # .nfs files are created when an open file is removed but is still being accessed
78
+ .nfs*
79
+
80
+ ### macOS ###
81
+ *.DS_Store
82
+ .AppleDouble
83
+ .LSOverride
84
+
85
+ # Icon must end with two \r
86
+ Icon
87
+
88
+
89
+ # Thumbnails
90
+ ._*
91
+
92
+ # Files that might appear in the root of a volume
93
+ .DocumentRevisions-V100
94
+ .fseventsd
95
+ .Spotlight-V100
96
+ .TemporaryItems
97
+ .Trashes
98
+ .VolumeIcon.icns
99
+ .com.apple.timemachine.donotpresent
100
+
101
+ # Directories potentially created on remote AFP share
102
+ .AppleDB
103
+ .AppleDesktop
104
+ Network Trash Folder
105
+ Temporary Items
106
+ .apdisk
107
+
108
+ ### OSX ###
109
+
110
+ # Icon must end with two \r
111
+
112
+
113
+ # Thumbnails
114
+
115
+ # Files that might appear in the root of a volume
116
+
117
+ # Directories potentially created on remote AFP share
118
+
119
+ ### Rails ###
120
+ *.rbc
121
+ capybara-*.html
122
+ .rspec
123
+ /log
124
+ /tmp
125
+ /db/*.sqlite3
126
+ /db/*.sqlite3-journal
127
+ /public/system
128
+ /coverage/
129
+ /spec/tmp
130
+ **.orig
131
+ rerun.txt
132
+ pickle-email-*.html
133
+
134
+ # TODO Comment out this rule if you are OK with secrets being uploaded to the repo
135
+ config/initializers/secret_token.rb
136
+
137
+ # Only include if you have production secrets in this file, which is no longer a Rails default
138
+ # config/secrets.yml
139
+
140
+ # dotenv
141
+ # TODO Comment out this rule if environment variables can be committed
142
+ .env
143
+
144
+ ## Environment normalization:
145
+ /.bundle
146
+ /vendor/bundle
147
+
148
+ # these should all be checked in to normalize the environment:
149
+ # Gemfile.lock, .ruby-version, .ruby-gemset
150
+
151
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
152
+ .rvmrc
153
+
154
+ # if using bower-rails ignore default bower_components path bower.json files
155
+ /vendor/assets/bower_components
156
+ *.bowerrc
157
+ bower.json
158
+
159
+ # Ignore pow environment settings
160
+ .powenv
161
+
162
+ # Ignore Byebug command history file.
163
+ .byebug_history
164
+
165
+ ### Ruby ###
166
+ *.gem
167
+ /.config
168
+ /InstalledFiles
169
+ /pkg/
170
+ /spec/reports/
171
+ /spec/examples.txt
172
+ /test/tmp/
173
+ /test/version_tmp/
174
+ /tmp/
175
+
176
+ # Used by dotenv library to load environment variables.
177
+ # .env
178
+
179
+ ## Specific to RubyMotion:
180
+ .dat*
181
+ .repl_history
182
+ build/
183
+ *.bridgesupport
184
+ build-iPhoneOS/
185
+ build-iPhoneSimulator/
186
+
187
+ ## Specific to RubyMotion (use of CocoaPods):
188
+ #
189
+ # We recommend against adding the Pods directory to your .gitignore. However
190
+ # you should judge for yourself, the pros and cons are mentioned at:
191
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
192
+ #
193
+ # vendor/Pods/
194
+
195
+ ## Documentation cache and generated files:
196
+ /.yardoc/
197
+ /_yardoc/
198
+ /rdoc/
199
+
200
+ ## Environment normalization:
201
+ /.bundle/
202
+ /lib/bundler/man/
203
+
204
+ # for a library or gem, you might want to ignore these files since the code is
205
+ # intended to run in multiple environments; otherwise, check them in:
206
+ # Gemfile.lock
207
+ # .ruby-version
208
+ # .ruby-gemset
209
+
210
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
211
+
212
+ ### RubyMine ###
213
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
214
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
215
+
216
+ # User-specific stuff:
217
+ .idea/**/workspace.xml
218
+ .idea/**/tasks.xml
219
+
220
+ # Sensitive or high-churn files:
221
+ .idea/**/dataSources/
222
+ .idea/**/dataSources.ids
223
+ .idea/**/dataSources.xml
224
+ .idea/**/dataSources.local.xml
225
+ .idea/**/sqlDataSources.xml
226
+ .idea/**/dynamic.xml
227
+ .idea/**/uiDesigner.xml
228
+
229
+ # Gradle:
230
+ .idea/**/gradle.xml
231
+ .idea/**/libraries
232
+
233
+ # Mongo Explorer plugin:
234
+ .idea/**/mongoSettings.xml
235
+
236
+ ## File-based project format:
237
+ *.iws
238
+
239
+ ## Plugin-specific files:
240
+
241
+ # IntelliJ
242
+ /out/
243
+
244
+ # mpeltonen/sbt-idea plugin
245
+ .idea_modules/
246
+
247
+ # JIRA plugin
248
+ atlassian-ide-plugin.xml
249
+
250
+ # Crashlytics plugin (for Android Studio and IntelliJ)
251
+ com_crashlytics_export_strings.xml
252
+ crashlytics.properties
253
+ crashlytics-build.properties
254
+ fabric.properties
255
+
256
+ ### RubyMine Patch ###
257
+ # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
258
+
259
+ # *.iml
260
+ # modules.xml
261
+ # .idea/misc.xml
262
+ # *.ipr
263
+
264
+ ### SublimeText ###
265
+ # cache files for sublime text
266
+ *.tmlanguage.cache
267
+ *.tmPreferences.cache
268
+ *.stTheme.cache
269
+
270
+ # workspace files are user-specific
271
+ *.sublime-workspace
272
+
273
+ # project files should be checked into the repository, unless a significant
274
+ # proportion of contributors will probably not be using SublimeText
275
+ # *.sublime-project
276
+
277
+ # sftp configuration file
278
+ sftp-config.json
279
+
280
+ # Package control specific files
281
+ Package Control.last-run
282
+ Package Control.ca-list
283
+ Package Control.ca-bundle
284
+ Package Control.system-ca-bundle
285
+ Package Control.cache/
286
+ Package Control.ca-certs/
287
+ Package Control.merged-ca-bundle
288
+ Package Control.user-ca-bundle
289
+ oscrypto-ca-bundle.crt
290
+ bh_unicode_properties.cache
291
+
292
+ # Sublime-github package stores a github token in this file
293
+ # https://packagecontrol.io/packages/sublime-github
294
+ GitHub.sublime-settings
295
+
296
+ ### Vim ###
297
+ # swap
298
+ [._]*.s[a-v][a-z]
299
+ [._]*.sw[a-p]
300
+ [._]s[a-v][a-z]
301
+ [._]sw[a-p]
302
+ # session
303
+ Session.vim
304
+ # temporary
305
+ .netrwhist
306
+ # auto-generated tag files
307
+ tags
308
+
309
+ ### Windows ###
310
+ # Windows thumbnail cache files
311
+ Thumbs.db
312
+ ehthumbs.db
313
+ ehthumbs_vista.db
314
+
315
+ # Folder config file
316
+ Desktop.ini
317
+
318
+ # Recycle Bin used on file shares
319
+ $RECYCLE.BIN/
320
+
321
+ # Windows Installer files
322
+ *.cab
323
+ *.msi
324
+ *.msm
325
+ *.msp
326
+
327
+ # Windows shortcuts
328
+ *.lnk
329
+
330
+ # End of https://www.gitignore.io/api/ruby,rubymine,rails,emacs,vim,sublimetext,osx,macos,linux,windows
331
+ .rspec_status
data/.rubocop.yml ADDED
@@ -0,0 +1,57 @@
1
+ AllCops:
2
+ Exclude:
3
+ - wor-prof.gemspec
4
+ - spec/spy.rb
5
+ - spec/dummy/db/**/*
6
+ - spec/dummy/config/**/*
7
+ - spec/spec_helper.rb
8
+ - lib/generators/*
9
+ - lib/wprof/version.rb
10
+
11
+ Documentation:
12
+ Enabled: false
13
+
14
+ LineLength:
15
+ Max: 120
16
+
17
+ Metrics/MethodLength:
18
+ Max: 20
19
+
20
+ FrozenStringLiteralComment:
21
+ Enabled: false
22
+
23
+ Metrics/BlockLength:
24
+ Enabled: true
25
+ Exclude:
26
+ - spec/**/*
27
+
28
+ # rubocop-rspec custom configurations
29
+
30
+ require: rubocop-rspec
31
+
32
+ RSpec/ExampleLength:
33
+ Enabled: false
34
+
35
+ RSpec/AnyInstance:
36
+ Enabled: false
37
+
38
+ RSpec/DescribeClass:
39
+ Enabled: false
40
+
41
+ RSpec/MultipleExpectations:
42
+ Enabled: false
43
+
44
+ RSpec/NestedGroups:
45
+ Max: 5
46
+
47
+ Lint/AmbiguousBlockAssociation:
48
+ Enabled: false
49
+
50
+ RSpec/LetSetup:
51
+ Enabled: false
52
+
53
+ RSpec/FilePath:
54
+ Exclude:
55
+ - spec/dummy_controller_without_gems_spec.rb
56
+ - spec/matchers_spec.rb
57
+ - spec/dummy_controller_spec.rb
data/.travis.yml ADDED
@@ -0,0 +1,35 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.5.3
4
+
5
+ services:
6
+ - redis-server
7
+
8
+ env:
9
+ global:
10
+ - RUBY_GC_MALLOC_LIMIT=90000000
11
+ - RUBY_GC_HEAP_FREE_SLOTS=200000
12
+ - CC_TEST_REPORTER_ID=2fcb230ef397cb43c693b113105b17ca39a3a65ac5093ca3096cbf6a3c0f1a98
13
+
14
+ before_install:
15
+ - "echo '--colour' > ~/.rspec"
16
+ - "echo 'gem: --no-document' > ~/.gemrc"
17
+
18
+ before_script:
19
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
20
+ - chmod +x ./cc-test-reporter
21
+ - ./cc-test-reporter before-build
22
+
23
+ script:
24
+ - bundle exec rspec spec -fd
25
+ - bundle exec rubocop app spec -R --format simple
26
+
27
+ after_script:
28
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
29
+
30
+ notifications:
31
+ email:
32
+ - maximiliano.colombo@wolox.com.ar
33
+
34
+ cache:
35
+ bundler: true
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in wprof.gemspec
6
+ gemspec
7
+
8
+ # Declare any dependencies that are still in development here instead of in
9
+ # your gemspec
10
+ group :development, :test do
11
+ gem 'bundler', '~> 1.13'
12
+ gem 'byebug', '~> 9.0'
13
+ gem 'faker', '~> 1.7.0'
14
+ gem 'rake', '~> 10.0'
15
+ gem 'rspec', '~> 3.0'
16
+ gem 'rubocop', '~> 0.49.1'
17
+ gem 'rubocop-rspec', '~> 1.15.0'
18
+ gem 'sidekiq'
19
+ gem 'webmock'
20
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Wolox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,86 @@
1
+ [![Build Status](https://travis-ci.org/Wolox/wor-prof.svg?branch=master)](https://travis-ci.org/Wolox/wor-prof)
2
+ [![Code Climate](https://codeclimate.com/github/Wolox/wor-prof/badges/gpa.svg)](https://codeclimate.com/github/Wolox/wor-prof)
3
+ [![Test Coverage](https://codeclimate.com/github/Wolox/wor-prof/badges/coverage.svg)](https://codeclimate.com/github/Wolox/wor-prof/coverage)
4
+
5
+ # Wor-Prof
6
+
7
+ Wor-prof (Wprof) is a gem for Ruby On Rails which its only purpose is to measure a RoR app's performance through a profile with different times of response. In order to accomplish that, Wprof uses ActiveSupport::Notifications (available in Rails since v4.0.2) to capture every action from his controllers. However, there's more. when using httparty in your project, you can capture every done request to external services. Do you have one or two methods that would like to know how long they take to execute? With Wprof you can find out.
8
+
9
+ Then, every data obtained can be reported in several ways, choose one from the Rails logger: database file, CSV text or go ahead and do a Post request wherever you want... Do it both synchronously or asynchronously.
10
+
11
+ ### Installation
12
+
13
+ Add the next line to the gemfile from your Rails application:
14
+
15
+ ```ruby
16
+ gem 'wor-prof'
17
+ ```
18
+
19
+ And then, execute:
20
+ ```bash
21
+ $ bundle install
22
+ ```
23
+ **That's it!!** At server execution, WProf immediately begins to work with default settings, so you won't need to configure anything if it matches with your needs, otherwise you can check **Available Settings** [here!](https://github.com/Wolox/wor-prof/wiki/User-Guide#available-configurations)
24
+
25
+ ## Complete User Guide!?? Where??
26
+
27
+ If you want to know more about this gem and how use it correctly, please visit Wiki sections. There you will find all configurations available and every detail.
28
+
29
+ [WIKI LINK -ALL DOCS HERE!](https://github.com/Wolox/wor-prof/wiki)
30
+
31
+ [ENGLISH VERSION](https://github.com/Wolox/wor-prof/wiki/User-Guide)
32
+
33
+ [VERSION ESPAÑOL](https://github.com/Wolox/wor-prof/wiki/Guia-de-Usuario)
34
+
35
+ ## Notes!!!
36
+
37
+ This gem use [HTTParty](https://github.com/jnunemaker/httparty) and [Sidekiq](https://github.com/mperham/sidekiq).
38
+ If you don't know anything about they, take a look in their repos!
39
+
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork it
44
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
45
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
46
+ 4. Run rubocop lint (`bundle exec rubocop -R --format simple`)
47
+ 5. Run rspec tests (`bundle exec rspec`)
48
+ 6. Push your branch (`git push origin my-new-feature`)
49
+ 7. Create a new Pull Request
50
+ ---
51
+ ## About ##
52
+
53
+ *This project was **developed** by ***[Maximiliano Colombo](https://github.com/mcolombo87)*** at ***[Wolox](http://www.wolox.com.ar).****
54
+
55
+ **Maintainers:** [Maximiliano Colombo](https://github.com/mcolombo87).
56
+
57
+ **Contributors:** Waiting For You!!!
58
+
59
+
60
+ ![Wolox](https://raw.githubusercontent.com/Wolox/press-kit/master/logos/logo_banner.png)
61
+
62
+ ---
63
+ ## License
64
+
65
+ **wor-prof** is available under the MIT [license](https://raw.githubusercontent.com/Wolox/wor-prof/master/LICENSE.md).
66
+
67
+ Copyright (c) 2019 Wolox
68
+
69
+ Permission is hereby granted, free of charge, to any person obtaining a copy
70
+ of this software and associated documentation files (the "Software"), to deal
71
+ in the Software without restriction, including without limitation the rights
72
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
73
+ copies of the Software, and to permit persons to whom the Software is
74
+ furnished to do so, subject to the following conditions:
75
+
76
+ The above copyright notice and this permission notice shall be included in all
77
+ copies or substantial portions of the Software.
78
+
79
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
80
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
82
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
83
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
84
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
85
+ SOFTWARE.
86
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "wprof"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here