dtracer 0.0.1 → 0.1.1
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 +4 -4
- data/.travis.yml +4 -0
- data/README.md +26 -4
- data/Rakefile +3 -1
- data/dtracer.gemspec +1 -1
- data/lib/dtracer/cli.rb +2 -3
- data/lib/dtracer/probe_listener.rb +1 -1
- data/lib/dtracer/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 615a6ebb2694accfce6866e83f5a6fe5b970af7d
|
4
|
+
data.tar.gz: 65e6b3632bfe2883b5234d88df07498a4fba4fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33ccbcfefdeea9ed1510811076115eabcdba0189551cf91031e98248c1188beb8cec81ca838ae08a4c05414dad50d714d8b8fe2dd0417798f6c45391df53a785
|
7
|
+
data.tar.gz: 833d13ddf2425f3bb1f7a85e6eb8f31360d937024784bc89d8d7fc6f25994ec2d8b857e1b3966cd543891c4d4656f8df4ae0e8c72f06deb9faf9251635d68528
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# DTracer
|
2
2
|
|
3
|
+
[](https://travis-ci.org/oarrabi/dtracer)
|
4
|
+
|
3
5
|
DTracer is part ruby gem, part iOS pod, that helps the sending and receiving of DTrace commands.
|
4
6
|
The `dtracer` gem will listen to the DTrace commands that are sent from the [OADTraceSender]() pod.
|
5
7
|
|
@@ -35,6 +37,7 @@ Note: registering a probe using DTrace requires admin privileges, running any dt
|
|
35
37
|
One good usage of DTrace is to log the network communicate instead of polluting the Xcode console.
|
36
38
|
|
37
39
|
Using DTrace to log network communication has the following benefits:
|
40
|
+
|
38
41
|
- Avoids Xcode console pollution with network logs.
|
39
42
|
- Extremely cheap; probes that are not being listened do not add any overhead.
|
40
43
|
|
@@ -44,15 +47,34 @@ Using `dtracer` command you can register 3 types of tracers.
|
|
44
47
|
|
45
48
|
#### Request probes
|
46
49
|
These are probes that listens to dtrace command sent from `[OADTracer traceRequest:]` objc method.
|
47
|
-
- `tracer curl`: outputs the the `NSURLRequest` send with the dtrace event as a curl command.
|
48
|
-
- `tracer details`: outputs the the `NSURLRequest` send with the dtrace event as a formatted string. You can pass it multiple flags to decide what to print from the request.
|
49
50
|
|
50
|
-
|
51
|
+
##### Curl
|
52
|
+
|
53
|
+
dtracer curl
|
54
|
+
|
55
|
+
Outputs the the `NSURLRequest` send with the dtrace event as a curl command.
|
56
|
+
|
57
|
+
##### Details
|
58
|
+
|
59
|
+
dtracer details
|
60
|
+
|
61
|
+
Outputs the the `NSURLRequest` send with the dtrace event as a formatted string. You can pass it multiple flags to decide what to print from the request.
|
62
|
+
|
63
|
+
run `dtracer help details` to check how to customize the output.
|
64
|
+
|
65
|
+
|
66
|
+
Using the `-r` flag with both of the above commands will add a response probe output.
|
51
67
|
|
52
68
|
#### Response probes
|
53
|
-
|
69
|
+
|
70
|
+
dtracer response
|
71
|
+
|
72
|
+
dtracer response adds a probe that outputs the `NSURLResponse`, `NSData` and `NSError` combination, sent using `[OADTracer traceResponse:data:error:]` objc method.
|
54
73
|
|
55
74
|
#### String probes
|
75
|
+
|
76
|
+
dtracer custom
|
77
|
+
|
56
78
|
In case you have the need to send any arbitrary string, then use `dtracer custom`; This command adds a probe that prints any string sent using `[OADTracer traceString:]` objc method.
|
57
79
|
|
58
80
|
## Contributing
|
data/Rakefile
CHANGED
data/dtracer.gemspec
CHANGED
@@ -19,7 +19,7 @@ The `dtracer` gem will listen to the DTrace commands that are sent from the [OAD
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency "rspec"
|
25
25
|
spec.add_dependency "thor"
|
data/lib/dtracer/cli.rb
CHANGED
@@ -33,9 +33,8 @@ class DTracer::CLI < Thor
|
|
33
33
|
option :b, :aliases => ["--body"], :type => :boolean, desc: "show the http body"
|
34
34
|
option :m, :aliases => ["--method"], :type => :boolean, desc: "show the http method"
|
35
35
|
option :u, :aliases => ["--url"], :type => :boolean, desc: "show the http url"
|
36
|
-
option :h, :aliases => ["--headers"], :type => :boolean, desc: "show the http
|
37
|
-
option :c, :aliases => ["--cookies"], :type => :boolean, desc: "show the http
|
38
|
-
option :q, :aliases => ["--quiet"], :type => :boolean, desc: "show the http url"
|
36
|
+
option :h, :aliases => ["--headers"], :type => :boolean, desc: "show the http headers"
|
37
|
+
option :c, :aliases => ["--cookies"], :type => :boolean, desc: "show the http cookies"
|
39
38
|
option :r, :aliases => ["--response"], :type => :boolean, desc: "include the request response"
|
40
39
|
desc "details", "register a curl probe"
|
41
40
|
|
data/lib/dtracer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dtracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omar Abdelhafith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,6 +77,7 @@ extensions: []
|
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
79
|
- .gitignore
|
80
|
+
- .travis.yml
|
80
81
|
- Gemfile
|
81
82
|
- LICENSE.txt
|
82
83
|
- README.md
|