Skip to content
colealanrobertsPublic

About

A lightweight Swift package for real-time performance monitoring.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

Repository files navigation

Tracer

A lightweight Swift package for real-time performance monitoring.

workflow license

Tracer

Tracer tracks frame rate and memory usage in real time, making it easy to capture and analyze performance logs directly on device.

Requirements

  • iOS 16.0+

Setup

Installation

Swift Package Manager

To install Tracer using Swift Package Manager, add the following dependency to your Package.swift file:

.package(url: "https://github.com/colealanroberts/Tracer.git")

Usage

Getting Started

To start collecting memory and frame samples, call Tracer.shared.startObservation().

import Tracer

@main struct MyApp: App {
    ...
    init() {
        Tracer.shared.startObservation()
    }
}

Viewing Sample Data

Tracer provides several mechanisms for viewing sample data. The simplest is TracerSamplingViewModifier, which can be applied to any SwiftUI view using .tracerWidgetOverlay(isPresented:).

MyView().tracerWidgetOverlay(isPresented: $isPresentingTracer)

However, for more granular control, use .tracerSamplingOverlay(isPresented:alignment:builder:), which allows full customization of the UI.

MyView().tracerSamplingOverlay(isPresented: $isPresentingTracer) { buffer in
    /// See `SampleBuffer.swift` for available properties.
}

License

This library is released under the MIT license. See LICENSE for details.

About

A lightweight Swift package for real-time performance monitoring.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages