Skip to content

Conversation

@groblegark
Copy link
Contributor

Summary

Add comprehensive diagnostic and performance profiling tools for the Dolt storage backend. This complements the recently merged test suite (#1299) and documentation (#1310).

New Files

cmd/bd/doctor/dolt.go (347 lines)

Adds Dolt-specific health checks to bd doctor:

Check Purpose
CheckDoltConnection Verify database connectivity
CheckDoltSchema Validate schema integrity
CheckDoltSync Check sync status with remotes
CheckDoltLock Detect stale lock files
CheckDoltServerMode Verify server mode configuration

cmd/bd/doctor/perf_dolt.go (506 lines)

Adds Dolt-specific performance diagnostics:

Feature Description
Connection timing Time to establish database connection
Query benchmarks List, show, filter operation timing
Complex queries Timing for joins and aggregations
Commit log queries dolt_log performance
Database statistics Issue counts, dependencies
CPU profiling Optional pprof profile generation

cmd/bd/doctor/types.go

  • Adds CategoryPerformance for grouping performance checks

Usage

# Run standard diagnostics (includes Dolt checks when applicable)
bd doctor

# Run Dolt-specific performance diagnostics
bd doctor perf --dolt

# Run with CPU profiling
bd doctor perf --dolt --profile

Example Output

=== Dolt Performance Diagnostics ===

Backend: dolt-embedded
Server Mode: false
Platform: linux/amd64
Go Version: go1.21.5
Database Size: 2.4 MB

Issues: 1,234 total (890 open, 344 closed)
Dependencies: 456

Timing (ms):
  Connection:     523
  Ready work:     45
  List open:      89
  Show issue:     12
  Complex query:  234
  Commit log:     167

Testing

All diagnostics are designed to:

  • Skip gracefully if Dolt backend isn't configured
  • Handle both embedded and server modes
  • Provide actionable error messages with fix suggestions

Related


🤖 Generated with Claude Code

Add comprehensive diagnostic tools for the Dolt storage backend:

## New Files

### cmd/bd/doctor/dolt.go (347 lines)
- CheckDoltConnection: Verify Dolt database connectivity
- CheckDoltSchema: Validate schema integrity
- CheckDoltSync: Check sync status with remotes
- CheckDoltLock: Detect stale lock files
- CheckDoltServerMode: Verify server mode configuration

### cmd/bd/doctor/perf_dolt.go (506 lines)
- RunDoltPerformanceDiagnostics: Comprehensive performance profiling
- Timing metrics for all major operations:
  - Connection establishment
  - Issue queries (list, show, filter)
  - Complex filter queries
  - Commit log queries
- Database statistics (issue counts, dependencies)
- Platform/version information
- Optional CPU profiling support

## Changes

### cmd/bd/doctor/types.go
- Add CategoryPerformance for grouping performance checks

## Usage

```bash
# Run standard diagnostics with Dolt checks
bd doctor

# Run Dolt performance diagnostics
bd doctor perf --dolt

# Run with CPU profiling
bd doctor perf --dolt --profile
```

## Related

- steveyegge#1299: Dolt test suite (merged)
- Complements existing doctor checks with Dolt-specific diagnostics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant