metrics-pipeline

Coordinate photo metrics updates across MySQL and Redis with single-writer processing.

132|42|Updated Aug 19, 2020
One-click install
npx skills add https://github.com/OpenLitterMap/openlittermap-web --skill metrics-pipeline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metrics-pipeline
Source: https://github.com/OpenLitterMap/openlittermap-web/tree/main/.ai/skills/metrics-pipeline
Command: npx skills add https://github.com/OpenLitterMap/openlittermap-web --skill metrics-pipeline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a centralized, single-writer metrics pipeline that coordinates photo metrics updates across MySQL and Redis, ensuring consistency and accuracy.

Core Features & Use Cases

  • Centralizes metrics for photos with a single writer (MetricsService) across time-series and caches.
  • Tracks processing state with four fields (processed_at, processed_fp, processed_tags, processed_xp) and ensures idempotent updates via fingerprinting.
  • Supports Redis-based leaderboards and per-user XP processing, with deterministic upserts across multiple timescales and scopes.
  • Use Case: Operational dashboards, contributor leaderboards, and reliable metric aggregation for photo activity.

Quick Start

Trigger the metrics pipeline by processing new photo events (tag verifications and admin actions) so MetricsService updates the metrics in MySQL and Redis.

Frequently Asked Questions about metrics-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep MySQL and Redis metrics consistent for event-driven photo updates?

A single-writer metrics pipeline coordinates MySQL and Redis updates by applying a four-state processing model with fingerprint-based idempotency, ensuring all photo events produce consistent, auditable analytics.

What is the best way to build contributor leaderboards using Redis without losing data?

Use Redis as a derived cache for leaderboards while maintaining the authoritative metrics in MySQL. This enables safe rebuilds from the metrics table and ensures deterministic upserts across multiple timescales and scopes.

How do I prevent duplicate metric calculations when processing the same photo event twice?

Prevent duplicate calculations using fingerprint-based idempotency. The pipeline tracks four fields—processed_at, processed_fp, processed_tags, and processed_xp—to ensure identical photo events do not trigger redundant metric updates.

Does the metrics pipeline support XP computation and per-user tracking?

Yes, the metrics pipeline supports per-user XP processing and tracking. It centralizes XP computations alongside tag verifications and admin actions to feed accurate data into Redis leaderboards and operational dashboards.

How do I safely rebuild Redis caches if the derived metrics become corrupted?

Safely rebuild Redis caches from the MySQL metrics table. Because Redis is a derived cache and the single-writer MetricsService governs all state, you can repopulate leaderboards and per-user XP deterministically without data loss.

What photo processing events should trigger a metrics pipeline update?

Trigger metrics pipeline updates for all photo processing events including tags, verification, admin actions, and deletion. The MetricsService processes these events to maintain dashboards, leaderboards, and XP computations accurately.