> ## Documentation Index
> Fetch the complete documentation index at: https://docs.basset.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# stackSamples

> Where the main thread spends its time, sampled and counted rather than caught once

Samples the main thread's stack on a timer. Identical stacks in a window
collapse into one reading with an `occurrenceCount` rather than repeating —
`stackSamples` is `stream, interval`, but the readings within a window are
themselves aggregated by shape.

| | |
| - | - |
| [Delivery](/instruments/metadata) | stream, interval |
| Mechanism | machCall |
| [Requires](/instruments/metadata) | iOS 17+, basset 0.1.1+ |

**Config** (`runtime.stackSamples:key=value,...`)

* `intervalMs` (int 10...1000): How often the main thread's stack is sampled. Default 50.

Real output from `basset request get`, captured against a running app —
trimmed here to one distinct stack out of the many the window reported:

```
CAPTURED                  ELAPSED  INSTRUMENT

launch 3936869398553027733
2026-08-23T14:39:36.725Z  +0.0s    runtime.stackSamples(stackSample)
├─ sampleCount         19
├─ unwindFailureCount  0
├─ windowNanoseconds   1001064667
├─ threadIsMain        true
├─ occurrenceCount     14
├─ frameAddress        9852781100
├─ frameAddress        9852780664
├─ frameAddress        6910460740
├─ frameAddress        6910239504
├─ frameAddress        6910235980
├─ frameAddress        9695024280
├─ frameAddress        7007966832
├─ frameAddress        7007355224
├─ frameAddress        7009503908
├─ frameAddress        4295722632
├─ frameAddress        4295722492
├─ frameAddress        4295722756
└─ frameAddress        6855760924
```

`occurrenceCount: 14` says this exact stack accounted for 14 of the window's
19 samples — the rest of the window held other, less common stacks, each its
own reading.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.