https://github.com/windler/go-cachegrind
GO package for parsing cachegrind files
https://github.com/windler/go-cachegrind
cachegrind go profiler xdebug
Last synced: 24 days ago
JSON representation
GO package for parsing cachegrind files
- Host: GitHub
- URL: https://github.com/windler/go-cachegrind
- Owner: windler
- License: mit
- Created: 2018-03-31T12:27:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-12T17:16:21.000Z (almost 8 years ago)
- Last Synced: 2025-01-20T16:53:42.672Z (over 1 year ago)
- Topics: cachegrind, go, profiler, xdebug
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://circleci.com/gh/windler/go-cachegrind) [](https://goreportcard.com/report/github.com/windler/go-cachegrind) [](https://codebeat.co/projects/github-com-windler-go-cachegrind-master)
# go-cachegrind
`go-cachegrind` is a GO library that parses files in [cachegrind compatible format](http://valgrind.org/docs/manual/cg-manual.html), used e.g. by [xdebug profiler](https://xdebug.org/docs/profiler). This package is mainly developed to parse xdebug profiling files.
# Installation
```bash
go get github.com/windler/go-cachegrind
```
# Usage
```go
cg := cachegrind.Parse("path/to/file.cachegrind")
main := cg.GetMainFunction()
totalTime := main.GetMeasurement("Time")
for _, call := range main.GetCalls() {
calledFn := call.GetFunction()
//...
}
```