Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Description

<!-- Describe your changes in detail -->

## Motivation and Context

<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->

## Type of Change

<!-- Put an 'x' in all the boxes that apply -->

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change)
- [ ] 📝 Documentation update
- [ ] 🧪 Test update
- [ ] 🔧 Configuration/build update

## How Has This Been Tested?

<!-- Please describe how you tested your changes -->
<!-- Include relevant details for your test configuration -->

- [ ] Test A
- [ ] Test B

**Test Configuration**:

- Ruby version:
- OS:

## Checklist

<!-- Put an 'x' in all the boxes that apply -->

- [ ] My code follows the code style of this project
- [ ] I have added tests to cover my changes
- [ ] All new and existing tests passed
- [ ] My change requires a change to the documentation
- [ ] I have updated the documentation accordingly
- [ ] I have added an entry to CHANGELOG.md

## Screenshots (if appropriate)

<!-- Add screenshots to help explain your changes -->
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ["2.7", "3.0", "3.1", "3.2", "3.3"]

steps:
- uses: actions/checkout@v4

- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run tests
run: bundle exec rspec

- name: Run analyzer (smoke test)
run: ruby bin/log_analyzer spec/files/development.log -s time

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Check for syntax errors
run: ruby -c bin/log_analyzer lib/**/*.rb

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run tests with coverage
run: bundle exec rspec
env:
COVERAGE: true
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Changelog

## [Unreleased]

### Added

- **HTML Export with DataTables.js**: Export analysis results to interactive HTML reports
- Sortable columns
- Searchable table
- Pagination support
- Color-coded performance indicators (green/yellow/orange/red)
- Responsive design with gradient styling
- Type badges for Partials (P) and Views (V)
- Usage: `log_analyzer log/production.log -html`
- Usage with short paths: `log_analyzer log/production.log -html --short`

### Features

The HTML export provides:

- Interactive table with client-side sorting and searching
- Beautiful gradient UI design
- Color-coded average rendering times:
- 🟢 Green: < 100ms (good performance)
- 🟡 Yellow: 100-400ms (moderate)
- 🟠 Orange: 400-800ms (warning)
- 🔴 Red: > 800ms (needs optimization)
- Type badges to distinguish Partials vs Views
- Mobile-responsive layout
- Powered by jQuery DataTables

## [0.3.3] - Previous Release
127 changes: 127 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Contributing to LogAnalyzer

First off, thank you for considering contributing to LogAnalyzer! 🎉

## Code of Conduct

This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

## How Can I Contribute?

### Reporting Bugs

Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible:

- **Use a clear and descriptive title**
- **Describe the exact steps to reproduce the problem**
- **Provide specific examples** (log files, commands used, etc.)
- **Describe the behavior you observed and what you expected**
- **Include your environment details** (Ruby version, OS, gem version)

### Suggesting Enhancements

Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:

- **Use a clear and descriptive title**
- **Provide a detailed description of the suggested enhancement**
- **Explain why this enhancement would be useful**
- **List some examples of how it would be used**

### Pull Requests

1. **Fork the repository** and create your branch from `master`
2. **Make your changes** following the coding standards below
3. **Add tests** if you've added code that should be tested
4. **Ensure the test suite passes** by running `bundle exec rspec`
5. **Update the documentation** if needed
6. **Add an entry to CHANGELOG.md** describing your changes
7. **Submit a pull request**

## Development Setup

```bash
# Clone your fork
git clone https://github.com/YOUR_USERNAME/log_analyzer.git
cd log_analyzer

# Install dependencies
bundle install

# Run tests
bundle exec rspec

# Run the analyzer locally
ruby bin/log_analyzer spec/files/development.log
```

## Coding Standards

- Follow Ruby style conventions
- Write clear, descriptive commit messages
- Add comments for complex logic
- Keep methods focused and concise
- Use meaningful variable and method names

## Testing

- Write RSpec tests for all new features
- Ensure existing tests pass before submitting PR
- Aim for good test coverage
- Test edge cases and error conditions

## Project Structure

```
log_analyzer/
├── bin/ # Executable scripts
│ └── log_analyzer # CLI entry point
├── lib/ # Main library code
│ ├── log_analyzer.rb # Main module
│ └── log_analyzer/ # Core classes
│ ├── analyzer.rb # Analysis logic
│ ├── configuration.rb
│ ├── stat.rb # Statistics calculations
│ ├── utils.rb # Helper methods
│ └── version.rb
├── spec/ # Test files
│ ├── files/ # Sample log files for testing
│ └── lib/ # Test specs
└── docs/ # Documentation and assets
```

## Feature Ideas

Looking for something to work on? Check out these ideas:

### High Priority

- [ ] Add percentile calculations (P95, P99)
- [ ] Time-based grouping (analyze by hour/day)
- [ ] Export to JSON format
- [ ] Progress bar for large files

### Medium Priority

- [ ] Controller/action grouping
- [ ] Trend analysis over time
- [ ] Memory usage tracking
- [ ] Database query analysis

### Nice to Have

- [ ] Web UI for viewing reports
- [ ] Real-time monitoring mode
- [ ] Configurable thresholds
- [ ] Multiple log format support

## Questions?

Feel free to open an issue with your question or reach out to the maintainer.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.

---

Thank you for contributing to LogAnalyzer! 🚀
Loading