Skip to content

Commit 34d323c

Browse files
committed
Add class diagram to docs via a new architecture page.
1 parent 254e392 commit 34d323c

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

architecture.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
5+
<title>ruby-prof</title>
6+
<link rel="stylesheet" type="text/css" href="assets/styles.css">
7+
</head>
8+
<body>
9+
<div class="header"><img src="./assets/ruby-prof-logo-white.svg"></div>
10+
<div class="grid-container">
11+
<nav role="navigation">
12+
<ul>
13+
<li><a href="#overview">Overview</a></li>
14+
<li><a href="#api-documentation">API Documentation</a></li>
15+
<li><a href="#license"></a><a href="#license">License</a></li>
16+
<li><a href="#development">Development</a></li>
17+
</ul>
18+
</nav>
19+
<div class="main">
20+
<h1>Architecuture<span> </span></h1>
21+
<p><a href="https://travis-ci.org/ruby-prof/ruby-prof"><img src="https://travis-ci.org/ruby-prof/ruby-prof.png?branch=master"
22+
alt="Build Status"></a></p>
23+
<h2><a id="overview">Overview</a></h2>
24+
<p>ruby-prof is a profiler for MRI Ruby. Its built as a C extension and
25+
therefore many times faster than the standard Ruby profiler. The image
26+
below shows the main classes that make up ruby-prof:</p>
27+
<p><br>
28+
</p>
29+
<img src="assets/class_diagram.png" alt="Class Diagram" title="Class Diagram">
30+
<p><br>
31+
</p>
32+
The top level class is Profile, which is returned by a profiling run:
33+
<pre class="ruby"><span class="ruby-identifier">profile = RubyProf.profile do </span><br> ..
34+
<span style="color: navajowhite;"> end</span></pre>
35+
<p>A profile owns a hash of threads, and threads in turn own the methods
36+
called in that thread as well as call trees which record how the
37+
methods were called.</p>
38+
<h2><a id="memory">Memory Management</a></h2>
39+
<p>The master object is the Profile object. Each Profile object is
40+
responsible for managing the memory of its child objects which are C
41+
structures. When the Profile object goes out of scope, it recursively
42+
frees all its objects.&nbsp; In the class diagram, this can bee seen
43+
by the composition relationships. The owning object is denoted with a
44+
filled in black diamond. Thus a Profile frees its threads, Threads
45+
free their Methods, etc.</p>
46+
<p><br>
47+
</p>
48+
<p><br>
49+
</p>
50+
</div>
51+
</div>
52+
</body>
53+
</html>

assets/class_diagram.drawio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile host="Electron" modified="2020-01-11T23:14:54.886Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/12.4.2 Chrome/78.0.3904.130 Electron/7.1.4 Safari/537.36" etag="qVjKL5Baaj49XJ3clcLG" version="12.4.2" type="device" pages="1"><diagram name="Page-1" id="c4acf3e9-155e-7222-9cf6-157b1a14988f">7Z1bc5s6EIB/jR+TQdx5jJ2knTPJnEyT6WkeZSPbpBh5sFIn/fVHAsmAxM2OwYmHTmdqrYVA0rer3ZVwR8Zk9fYthuvlPfZRONI1/21kXI90HbiWR/9hkvdUYulmKljEgc8rZYLH4C/iQo1LXwMfbQoVCcYhCdZF4QxHEZqRggzGMd4Wq81xWLzrGi6QInicwVCV/hf4ZJlKXUvL5N9RsFiKOwONfzOFs9+LGL9G/H4j3Zgnf9KvV1C0xetvltDH25zIuBkZkxhjkn5avU1QyMZWDFt63W3Ft7vnjlFEWl3gwNkUWo7pIsvw7OmFeLA/MHzlg/EQ43lARyZ9YPIuBmmzDVYhjGhpvCSrkAoB/TjHEXnklTRani2D0L+D7/iVPdCG0AESpfESx8FfWh+Ki+nXMeE46DZrLQjDCQ5xTAURTu+1u+iRNcZvE6MNvexBdBzsRHdwQ8Sj4DCE600wTR6OVVnBeBFEY0wIXvFKole3uTtns0hbZZOLfFFbzF/a/iqY8c8hnKJwvKNB6sOGxPj3Di0xbLdwFYRMY36i2IcRFKOZjgdgzcIwWES0MKPdRLTBsTrhnIE/KCboLSfiAHxDeIVI/E6r8G9NO72C66ogYJuBD2wuW+ag97gMcl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1 KB
Loading

index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<li><a href="#reports">Reports</a></li>
1919
<li><a href="#performance">Performance</a></li>
2020
<li><a href="#profiling-rails">Profiling Rails</a></li>
21+
<li><a href="#architecture">Architecture</a></li>
2122
<li><a href="#version-1.0">Version 1.0</a></li>
2223
<li><a href="#api-documentation">API Documentation</a></li>
2324
<li><a href="#license"></a><a href="#license">License</a></li>
@@ -453,6 +454,13 @@ <h2><a id="profiling-rails"> Profiling Rails</a></h2>
453454
previous request!</p>
454455
</li>
455456
</ol>
457+
<h2><a id="architecture">Architecture<br>
458+
</a></h2>
459+
<p>To learn more about how ruby-prof works internally please see the <a
460+
href="./architecture.html" title="Architecture">architecture </a>page.</p>
461+
<p></p>
462+
<ol>
463+
</ol>
456464
<h2><a id="version-1.0">Version 1.0</a></h2>
457465
<p>ruby-prof's development stretches all the way back to 2005. Fourteen
458466
years later, it seems time for version 1.0! Version 1.0 is a
@@ -475,6 +483,7 @@ <h2><a id="version-1.0">Version 1.0</a></h2>
475483
<li>
476484
<p>The ability track object allocations</p>
477485
</li>
486+
<li>New documentation <a href="https://ruby-prof.github.io">website</a>.</li>
478487
</ul>
479488
<p>At the same time, it was also time to remove old code and deprecated
480489
methods. These changes include:</p>

0 commit comments

Comments
 (0)