A proof of concept for profiling user attention.
It has a macos client written in SwiftUI that captures the foreground state and stores it using OpenTelemetry. There are many backend implementations for exploring and analysing otel data, but I used Jaeger, which has a slim local solution for developers.
- Clone this repository.
- Load the attenprofiler project using xcode.
- Use docker to run the trace collector: Jaeger All in one
- Build and start the app in xcode.
- In attnprofiler, press the start button. This starts the "workstream".
- Do some normal stuff, switching between apps. attnprofiler should update with the foreground app.
- In attnprofiler, press the stop button. This closes the "workstream".
- (Optional) feel free to repeat steps 5-7 to add more data.
- You can then navigate to http://localhost:16686 to access the Jaeger UI.
- In Jaeger, switch to the Search tab and look for "attnprofiler" in the Services drop down.
- Traces may take a couple of minutes to process and show up in the UI.
- Great overview of Open Telemetry - https://github.com/magsther/awesome-opentelemetry#open-source
- Swift specific implementation - https://opentelemetry.io/docs/instrumentation/swift/
- Comprehensive self-contained demo of OT - https://github.com/open-telemetry/opentelemetry-demo