Skip to content

colealanroberts/Tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages