@@ -16,7 +16,7 @@ It is the **base construct** used to measure resource consumption across differe
1616
1717` Snapshots ` are ** read-only** after creation.
1818
19- ### Create a Snapshot
19+ ### Take a Snapshot
2020
2121You can create a snapshot using the ` now() ` static method:
2222
@@ -45,8 +45,6 @@ $snapshot->cpuSystemTime;
4545$snapshot->hrtime;
4646```
4747
48- ### Labels
49-
5048You can optionally attach a label to a ` Snapshot ` . If you do not assign a label to the snapshot, one will be
5149automatically assigned to it. Labels can include lowercase letters, digits, dots, underscores,
5250and hyphens—but cannot start or end with a symbol, nor have consecutive symbols.
@@ -96,14 +94,13 @@ $span->range; // represents the file range between the start and end (the locat
9694$span->metrics // the calculated metrics computed from the 2 snapshots.
9795```
9896
99- ### Label
10097
10198The ` label ` property is similar to the snapshot identity and uses the same requirements. But, in contrast to
10299the ` Snapshot ` , ** the label value is mandatory** .
103100
104- ### Metrics
101+ ## Metrics
105102
106- The ` metrics ` property is a ` Metrics ` value object which exposes the following readonly metric:
103+ The ` Span:: metrics` property is a ` Metrics ` value object which exposes the following readonly metric:
107104
108105- ` executionTime `
109106- ` cpuTime `
@@ -129,9 +126,9 @@ $span->metrics->realPeakMemoryUsage; // in bytes
129126$span->metrics->realPeakMemoryUsageGrowth; // in bytes
130127```
131128
132- ### Call Location Range
129+ ## Call Location Range
133130
134- The ` range ` property is a ` CallRange ` value object which allows comparing the call location between
131+ The ` Spab:: range` property is a ` CallRange ` value object which allows comparing the call location between
135132the starting and the ending snapshots.
136133
137134``` php
@@ -166,7 +163,7 @@ $span->range->isDifferentLine(); //returns false if the both locations are the s
166163The ` Report ` value object represents a ** profiling or metrics summary** of a process, function or operation. It encapsulates ** row-level statistics**
167164for each metric type (CPU time, memory usage, etc.) and provides ** column-oriented access** to aggregated metrics.
168165
169- ### Accessing Row-Level Statistics
166+ ### Row-Level Statistics
170167
171168You can retrieve a single row of metrics ( a ` Statistics ` object) by metric type:
172169
@@ -177,7 +174,7 @@ $report = stack_report(fn () => true, iterations: 50);
177174$cpuRow = $report->row(MetricType::CpuTime); //returns a Statistics object
178175```
179176
180- ### Accessing Column-Level Aggregated Metrics
177+ ### Column-Level Metrics
181178
182179You can also retrieve aggregated metrics (like min, max, average) ** across all types** for a given aggregation:
183180
@@ -230,7 +227,7 @@ All the value objects can be
230227- JSON-encoded via ` json_encode ` (implementing the ` JsonSerializable ` interface)
231228- Returned in a ** human-readable** format via ` toHuman() ` . (except for the ` CallLocation ` and the ` CallRange ` objects.
232229
233- ### Full human -readable export
230+ ### Human -readable export
234231
235232The human-readable export automatically converts ** nanoseconds** and ** bytes** into more human-friendly
236233formats depending on the recorded values.
0 commit comments