Go to file
Oliver Falk 9ec9c60bad Implement cached robohash as default with 270x performance improvement
- Add CachedRobohash class with intelligent image caching
- Cache robot parts at 1024x1024 resolution to eliminate repeated Image.open() calls
- Provide 2.6x additional performance improvement on top of existing optimizations
- Maintain 100% pixel-perfect compatibility with optimized robohash
- Simplify configuration to single ROBOHASH_CACHE_SIZE setting
- Update views.py to use create_robohash() as default function
- Add comprehensive test suite with 10 tests covering functionality and performance
- Achieve ~26ms average generation time vs ~7000ms original (270x faster)
- Memory usage: ~10-30MB configurable cache with automatic cleanup
- Cache hit rate: ~83% in typical usage scenarios

This makes robohash performance competitive with other avatar generators
while maintaining complete backward compatibility.
2025-10-27 13:05:54 +01:00
2023-05-15 18:58:22 +00:00
2025-10-18 13:01:20 +02:00
2023-02-14 21:43:16 +01:00
2025-02-10 16:54:28 +01:00
2018-07-11 10:09:28 +02:00
2018-11-06 13:38:09 +01:00
2025-09-06 10:26:56 +02:00

ivatar / libravatar

Pipeline and coverage status

pipeline status coverage report

Reports / code documentation

Environment Variables

OpenTelemetry Configuration

OpenTelemetry instrumentation is always enabled in ivatar. The following environment variables control the behavior:

Core Configuration

  • OTEL_SERVICE_NAME: Service name for OpenTelemetry (default: "ivatar")
  • OTEL_ENVIRONMENT: Deployment environment (default: "production")
  • OTEL_EXPORT_ENABLED: Enable/disable data export (default: "false")
    • Set to "true" to enable sending telemetry data to external collectors
    • Set to "false" to disable export (instrumentation still active)

Export Configuration

  • OTEL_EXPORTER_OTLP_ENDPOINT: OTLP endpoint for traces and metrics export
  • OTEL_PROMETHEUS_ENDPOINT: Prometheus metrics endpoint (default: "0.0.0.0:9464")

Example Configurations

Development (Export Disabled)

export OTEL_EXPORT_ENABLED=false
export OTEL_SERVICE_NAME=ivatar-dev
export OTEL_ENVIRONMENT=development

Production (Export Enabled)

export OTEL_EXPORT_ENABLED=true
export OTEL_SERVICE_NAME=ivatar
export OTEL_ENVIRONMENT=production
export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317

Testing

Running Tests

For local development, use the provided script to skip Bluesky tests that require external API credentials:

./scripts/run_tests_local.sh

This runs all tests except those marked with @pytest.mark.bluesky.

All Tests

To run all tests including Bluesky tests (requires Bluesky API credentials):

python3 manage.py test -v3

Specific Test Categories

# Run only Bluesky tests
python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v3

# Run only file upload security tests
python3 manage.py test ivatar.test_file_security -v3

# Run only upload tests
python3 manage.py test ivatar.ivataraccount.test_views -v3

Test Markers

Tests are categorized using pytest markers:

  • @pytest.mark.bluesky: Tests requiring Bluesky API credentials
  • @pytest.mark.slow: Long-running tests
  • @pytest.mark.integration: Integration tests
  • @pytest.mark.unit: Unit tests

Authors and contributors

Lead developer/Owner: Oliver Falk (aka ofalk or falko) - https://git.linux-kernel.at/oliver

Operations: Michal Novotny (aka clime)

QA: Tristan Le Guern (aka tleguern)

Frontend developer: Lukas Schönsgibl (aka hybridpicker), Niklas Poslovski (aka nipos)

Organisation/Meeting moderation: Lars Kruse (aka sumpfralle)

Initial developer: François Marier - https://fmarier.org/

Description
No description provided
Readme AGPL-3.0 32 MiB
Languages
PostScript 94.5%
Python 3.8%
CSS 0.7%
HTML 0.7%
JavaScript 0.3%