Skip to content

Commit c32bb3c

Browse files
author
Charlie Savage
committed
Updating documentation for 1.0 release.
1 parent bc58f29 commit c32bb3c

19 files changed

+3775
-356
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea

assets/ruby-prof-logo-blue.svg

+1
Loading

assets/[email protected]

3.03 KB
Loading

assets/[email protected]

4.59 KB
Loading

assets/ruby-prof-logo-white.svg

+1
Loading

assets/[email protected]

2.75 KB
Loading

assets/[email protected]

4.11 KB
Loading

assets/ruby-prof-logo.svg

+1
Loading

assets/styles.css

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
body {
2+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
3+
margin: 0;
4+
padding: 0;
5+
font-size: 16px;
6+
}
7+
8+
h1, h2, h3, h4, h5, h6 {
9+
margin-top: 1rem;
10+
margin-bottom: 0;
11+
}
12+
13+
h6 {
14+
font-size: 0.75rem;
15+
text-transform: uppercase;
16+
letter-spacing: 1.5px;
17+
color: rgba(255, 255, 255, 0.6);
18+
}
19+
20+
div.main {
21+
margin: 1em 2em;
22+
}
23+
24+
nav a {
25+
text-decoration: none;
26+
}
27+
28+
p {
29+
margin-top: 0.25em;
30+
}
31+
32+
pre {
33+
background-color: #e3e8fa;
34+
border-radius: 3px;
35+
font-size: 85%;
36+
line-height: 1.45;
37+
overflow: auto;
38+
background: #6573aa;
39+
padding: 16px;
40+
color: white;
41+
padding: 0.5em;
42+
}
43+
44+
li {
45+
margin-top: 0.75em;
46+
}
47+
48+
dt {
49+
font-weight: bold;
50+
display: list-item;
51+
margin-left: 4rem;
52+
}
53+
54+
dd {
55+
margin-top: 0.25rem;
56+
margin-bottom: 0.75rem;
57+
margin-left: 5rem;
58+
}
59+
60+
.header {
61+
background-color: #0D2483;
62+
color: white;
63+
padding: 1.5rem 2rem;
64+
}
65+
66+
.header > div {
67+
display: flex;
68+
flex-direction: row;
69+
align-items: center;
70+
}
71+
72+
.header h1 {
73+
margin-bottom: 0;
74+
}
75+
76+
.table-header {
77+
padding: 3rem 0 1rem;
78+
}
79+
80+
.table-wrapper {
81+
margin: 1rem auto;
82+
max-width: 1440px;
83+
padding: 4rem 5rem;
84+
background: white;
85+
border-radius: 0.5rem;
86+
}
87+
88+
.center {
89+
max-width: 1440px;
90+
margin: 0 auto;
91+
}
92+
93+
.layout-right {
94+
margin-left: auto;
95+
}
96+
97+
.text-right {
98+
display: flex;
99+
align-items: flex-end;
100+
flex-direction: column;
101+
}
102+
103+
.timestamp {
104+
font-size: 12px;
105+
margin-bottom: 1rem;[]
106+
color: rgba(255, 255, 255, 0.6);
107+
}
108+
109+
.logo {
110+
width: 140px;
111+
height: 30px;
112+
opacity: 0.5;
113+
background-repeat: no-repeat;
114+
background-image: url(ruby-prof-logo.svg);
115+
}
116+
117+
.ruby-constant { color: #7fffd4; background: transparent; }
118+
.ruby-keyword { color: #00ffff; background: transparent; }
119+
.ruby-ivar { color: #eedd82; background: transparent; }
120+
.ruby-operator { color: #00ffee; background: transparent; }
121+
.ruby-identifier { color: #ffdead; background: transparent; }
122+
.ruby-node { color: #ffa07a; background: transparent; }
123+
.ruby-comment { color: #dc0000; background: transparent; }
124+
.ruby-regexp { color: #ffa07a; background: transparent; }
125+
.ruby-value { color: #7fffd4; background: transparent; }
126+
127+
128+
.grid-container {
129+
display: grid;
130+
grid-template-columns: 15% 85%;
131+
grid-auto-rows: 2em;
132+
grid-gap: .5em;
133+
}

examples/flat.txt

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
= Flat Profiles
2+
3+
Flat profiles show the total amount of time spent in each method.
4+
As an example, here is the output from running printers_test.rb.
5+
6+
Measure Mode: wall_time
7+
Thread ID: 70355159212340
8+
Fiber ID: 70355171633140
9+
Total: 0.060485
10+
Sort by: self_time
11+
12+
%self total self wait child calls name
13+
97.07 0.059 0.059 0.000 0.000 1001 Integer#upto
14+
0.92 0.059 0.001 0.000 0.059 1000 Object#is_prime
15+
0.66 0.060 0.000 0.000 0.059 1 Array#select
16+
0.59 0.000 0.000 0.000 0.000 1000 Kernel#rand
17+
0.50 0.001 0.000 0.000 0.000 1 Array#each_index
18+
0.20 0.000 0.000 0.000 0.000 1000 Kernel#respond_to_missing?
19+
0.01 0.000 0.000 0.000 0.000 1 Object#find_largest
20+
0.01 0.060 0.000 0.000 0.060 1 PrintersTest#setup
21+
0.01 0.060 0.000 0.000 0.060 1 Object#find_primes
22+
0.01 0.000 0.000 0.000 0.000 1 Class#new
23+
0.01 0.060 0.000 0.000 0.060 1 Object#run_primes
24+
0.00 0.000 0.000 0.000 0.000 1 Array#first
25+
0.00 0.001 0.000 0.000 0.001 1 Object#make_random_array
26+
0.00 0.000 0.000 0.000 0.000 1 Array#initialize
27+
28+
All values are in seconds.
29+
30+
The columns are:
31+
32+
%self - The percentage of time spent in this method, derived from self_time/total_time
33+
total - The time spent in this method and its children.
34+
self - The time spent in this method.
35+
wait - amount of time this method waited for other threads
36+
child - The time spent in this method's children.
37+
calls - The number of times this method was called.
38+
name - The name of the method.
39+
40+
Methods are sorted based on %self, therefore the methods that execute the longest are listed
41+
first.
42+
43+
For example, wee can see that Integer#upto took the most time, 0.059
44+
seconds. Method Object#is_prime calls this method, so the 0.59
45+
seconds appear as child time for Object#is_prime.
46+
47+
The interpretation of method names is:
48+
* MyObject#test - An instance method "test" of the class "MyObject"
49+
* <Object:MyObject>#test - The <> characters indicate a singleton method on a singleton class.
50+

examples/graph.dot

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
digraph "Profile" {
2+
labelloc=t;
3+
labeljust=l;
4+
subgraph "Thread 70140045951280" {
5+
70140046535720 [label="setup\n(100%)"];
6+
70140046535720 -> 70140046535660 [label="1/1" fontsize=10 fontcolor="#666666"];
7+
70140046535660 [label="run_primes\n(100%)"];
8+
70140046535660 -> 70140046534940 [label="1/1" fontsize=10 fontcolor="#666666"];
9+
70140046535660 -> 70140046535640 [label="1/1" fontsize=10 fontcolor="#666666"];
10+
70140046535660 -> 70140046534640 [label="1/1" fontsize=10 fontcolor="#666666"];
11+
70140046534940 [label="find_primes\n(93%)"];
12+
70140046534940 -> 70140046534920 [label="1/1" fontsize=10 fontcolor="#666666"];
13+
70140046534920 [label="select\n(93%)"];
14+
70140046534920 -> 70140046534840 [label="200/200" fontsize=10 fontcolor="#666666"];
15+
70140046534840 [label="is_prime\n(90%)"];
16+
70140046534840 -> 70140046534820 [label="200/201" fontsize=10 fontcolor="#666666"];
17+
70140046534820 [label="upto\n(87%)"];
18+
70140046535640 [label="make_random_array\n(7%)"];
19+
70140046535640 -> 70140046535500 [label="1/1" fontsize=10 fontcolor="#666666"];
20+
70140046535640 -> 70140046535600 [label="1/1" fontsize=10 fontcolor="#666666"];
21+
70140046535500 [label="each_index\n(6%)"];
22+
70140046535500 -> 70140046535140 [label="200/200" fontsize=10 fontcolor="#666666"];
23+
70140046535140 [label="rand\n(4%)"];
24+
70140046535140 -> 70140046535100 [label="200/200" fontsize=10 fontcolor="#666666"];
25+
70140046535100 [label="respond_to_missing?\n(1%)"];
26+
70140046534640 [label="find_largest\n(1%)"];
27+
70140046534640 -> 70140046534820 [label="1/201" fontsize=10 fontcolor="#666666"];
28+
70140046534640 -> 70140046534620 [label="1/1" fontsize=10 fontcolor="#666666"];
29+
70140046535600 [label="new\n(0%)"];
30+
70140046535600 -> 70140046535580 [label="1/1" fontsize=10 fontcolor="#666666"];
31+
70140046535580 [label="initialize\n(0%)"];
32+
70140046534620 [label="first\n(0%)"];
33+
}
34+
subgraph cluster_70140046962360 {
35+
label = "PrintersTest";
36+
fontcolor = "#666666";
37+
fontsize = 16;
38+
color = "#666666";
39+
70140046535720;
40+
}
41+
subgraph cluster_70140046962240 {
42+
label = "Object";
43+
fontcolor = "#666666";
44+
fontsize = 16;
45+
color = "#666666";
46+
70140046535660;
47+
70140046535640;
48+
70140046534940;
49+
70140046534840;
50+
70140046534640;
51+
}
52+
subgraph cluster_70140046962040 {
53+
label = "Class";
54+
fontcolor = "#666666";
55+
fontsize = 16;
56+
color = "#666666";
57+
70140046535600;
58+
}
59+
subgraph cluster_70140046961920 {
60+
label = "Array";
61+
fontcolor = "#666666";
62+
fontsize = 16;
63+
color = "#666666";
64+
70140046535580;
65+
70140046535500;
66+
70140046534920;
67+
70140046534620;
68+
}
69+
subgraph cluster_70140046961720 {
70+
label = "Kernel";
71+
fontcolor = "#666666";
72+
fontsize = 16;
73+
color = "#666666";
74+
70140046535140;
75+
70140046535100;
76+
}
77+
subgraph cluster_70140046961280 {
78+
label = "Integer";
79+
fontcolor = "#666666";
80+
fontsize = 16;
81+
color = "#666666";
82+
70140046534820;
83+
}
84+
}

0 commit comments

Comments
 (0)