Skip to content

jpdro/goanalysis

 
 

Repository files navigation

🔍 GoAnalysis

中文版 | English

GoAnalysis

Go Function Tracing & Visualization Tool

License Version Go

🌟 Overview

Professional Go function tracing analysis tool with advanced visualization. Built with Kratos backend and Vue3 frontend.

🚀 Features

  • 🔍 Function Tracing - Real-time goroutine execution capture
  • 📊 Visualization - Interactive Mermaid flowcharts and heatmaps
  • 📈 Performance - Bottleneck identification and analysis
  • 🔄 Git Integration - GitLab MR change analysis
  • 🌐 Web UI - Modern Vue3 interface

🛠️ Tech Stack

  • Backend: Kratos, gRPC, SQLite
  • Frontend: Vue3, Bootstrap, ECharts
  • Visualization: Mermaid.js, D3.js

🚀 Quick Start

Using Pre-built Binaries

  1. Download from GitHub Releases
  2. Extract and run:
    # Linux
    ./goanalysis-linux-v* server
    
    # Windows  
    goanalysis-windows-v*.exe server
  3. Open http://localhost:8000

Building from Source

git clone https://github.com/toheart/goanalysis.git
cd goanalysis
make init
make sync-frontend  
make build
./bin/goanalysis server

⚙️ Configuration

Edit configs/config.yaml:

server:
  http:
    addr: 0.0.0.0:8000
  grpc:
    addr: 0.0.0.0:9000

data:
  dbpath: ./goanalysis.db

biz:
  gitlab:
    token: "${GITLAB_TOKEN}"
    url: "${GITLAB_API_URL}"

📡 API Endpoints

Endpoint Method Description
/api/gids GET Get goroutine IDs
/api/functions GET List traced functions
/api/traces/{gid} GET Get trace details
/api/traces/{gid}/mermaid GET Get diagram data

🔧 Usage

Basic Tracing

./goanalysis server
./goanalysis rewrite -d /path/to/project

Git Analysis

export GITLAB_TOKEN="your-token"
./goanalysis gitanalysis --project=123 --mr=45

📂 Project Structure

├── api/           # API definitions
├── cmd/           # CLI commands  
├── internal/      # Core logic
├── web/           # Frontend files
└── configs/       # Configuration

🏗️ Deployment

Docker

docker run -p 8000:8000 -p 9000:9000 \
  ghcr.io/toheart/goanalysis:latest

Build

make package-linux
make package-windows

🔧 Troubleshooting

Issue Solution
Port in use lsof -i :8000; kill -9 <PID>
DB locked rm -f goanalysis.db-*
Frontend missing make sync-frontend

🤝 Contributing

  1. Fork repository
  2. Create feature branch
  3. Make changes with tests
  4. Submit pull request

Follow Conventional Commits.

📜 Releases

Version Date Changes
v1.1.4 2024-12-16 GitLab integration
v1.1.0 2024-12-01 Vue3 upgrade
v1.0.0 2024-11-15 First stable

📄 License

MIT License - see LICENSE file.

📞 Support

📱 Follow WeChat

小唐的技术日志

WeChat QR Code

Scan for latest updates


GoAnalysis - Empowering Go developers

⭐ Star us on GitHub!

About

go语言代码分析 工具

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 98.0%
  • Makefile 1.7%
  • Dockerfile 0.3%