krlvi / selfprofiler

Like software profiling, but for humans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SelfProfiler

SelfProfiler is a script that samples the currently active window, streaming Trace Event Format events containing the frontmost application name and window title to standard out.

If the output is piped into a file it can be read by the Google Chrome Trace Event Profiling Tool.

Currently only OSX is supported via the Accessability APIs.

Usage

The terminal will require access to OSX Accessability, which is enabled via System Preferences -> Security & Privacy -> Privacy -> Accessibility where you can add the terminal emulator that you use.

$ ./selfprofiler.sh > prof.json

In Google Chrome navigate to about://tracing and load prof.json.

If you want to resume a started session you can use the --resume flag.

$ ./selfprofiler.sh --resume >> prof.json

Example

Here is an example profiling output which when loaded in Google Chrome's Trace Event Profiling Tool looks as follows:

Trace Event Profiling Tool Screenshot

Contributing

Pull requests are welcome :)

License

Copyright © 2019 Kiril Videlov

Distributed under the Eclipse Public License.

About

Like software profiling, but for humans

License:Eclipse Public License 1.0


Languages

Language:Shell 100.0%