Skip to content
smattymatty edited this page Aug 25, 2025 · 3 revisions

Django Mercury Wiki

Test Django app speed. Learn why it's slow. Fix it.

Django Mercury embodies the 80-20 Human-in-the-Loop philosophy - automating repetitive analysis while preserving human learning and decision-making.

πŸš€ Quick Navigation

For New Users

For Contributors

Plugin System

🎯 The Three Audiences Pattern

Django Mercury adapts to your needs through profiles:

# First-time setup - choose your profile
mercury-test --profile student  # Educational mode with quizzes
mercury-test --profile expert   # Fast, efficient testing
mercury-test --profile agent    # Structured output for AI/CI

Each profile automatically configures the right plugins for your workflow.

πŸ“š Core Concepts

Performance Testing Philosophy

  • 80% Automation: Mercury handles query counting, timing, memory tracking
  • 20% Human Intelligence: You understand the context and make optimization decisions

Educational Mission

Mercury was created for EduLite to help students learn with limited internet. Our tools work for:

  • Students on slow connections
  • Developers with older hardware
  • Global contributors with varying resources

Plugin Architecture

Mercury uses a small core, big plugin design:

  • Minimal core functionality
  • Rich plugin ecosystem
  • Profile-based plugin configuration
  • Audience-aware features

πŸ”§ Common Tasks

Running Tests with Mercury

# Automatic monitoring (investigation)
from django_mercury import DjangoMercuryAPITestCase

class MyTest(DjangoMercuryAPITestCase):
    def test_api(self):
        response = self.client.get('/api/endpoint/')
        # Mercury monitors automatically!

# Manual control (production)
from django_mercury import DjangoPerformanceAPITestCase
from django_mercury import monitor_django_view

class MyTest(DjangoPerformanceAPITestCase):
    def test_with_assertions(self):
        with monitor_django_view("operation") as monitor:
            response = self.client.get('/api/endpoint/')
        
        self.assertResponseTimeLess(monitor, 100)
        self.assertQueriesLess(monitor, 10)

Using Plugins

# List available plugins for your profile
mercury-test --list-plugins

# Use specific plugin features
mercury-test --wizard           # Interactive test selection
mercury-test --learn            # Start learning mode
mercury-test --search-deep      # Deep project discovery

πŸ“– Documentation Structure

User Guides

  • Getting Started: Installation, basic usage, first tests
  • API Reference: Complete API documentation
  • Test Case Examples: Real-world usage patterns

Plugin Documentation

  • Plugin System Overview: Architecture and design
  • Creating Plugins: Build your own extensions
  • Plugin Configuration: Profile-based settings

Contributing

  • Development Setup: Environment configuration
  • Coding Standards: Python and C guidelines
  • Testing Requirements: Quality assurance

🌟 Project Values

Fair, Free, Open

  • Fair: Equal opportunity for all contributors
  • Free: No barriers to participation
  • Open: Transparent development

Human-in-the-Loop

  • Tools make developers smarter, not obsolete
  • Automate the mundane, preserve the meaningful
  • Every error is a learning opportunity

πŸ†˜ Getting Help

πŸ“Š Latest Release

Current version: 1.0.0

  • βœ… Plugin system with profile support
  • βœ… Educational mode with quizzes
  • βœ… Smart project discovery
  • βœ… Performance grading (S, A+, A, B, C, D, F)

Django Mercury: Making performance testing accessible to developers worldwide.

Built with ❀️ by the 80-20 Human-in-the-Loop community.