CrystalCommunity::GitHubCrystalStatsCollector
Collects public GitHub stats for Crystal repositories via the REST API. Intended for scheduled runs (e.g. hourly cron). Counts only public data.
- Excludes forks via repo search query
fork:false. - Repo discovery subdivides Search by
stars(thenpushedif needed) to approach full universe past the 1000-results/query cap. - Excludes bots by login suffix
"[bot]"for unique-owner counts only. - Rolling 30-day window (UTC) from collection time for pushed/created repo counts.
- Star totals and buckets, owner User vs Organization, and top topics come from Search
items(no per-repo GETs). - No file or DB cache: every run loads the repo list from Search.
Constants
BASE_REPO_SEARCH = "language:Crystal fork:false"
DEFAULT_PER_PAGE = 100
GITHUB_API = "https://api.github.com"
MAX_RATE_LIMIT_WAITS = 32
MAX_SEARCH_PAGES = 10
PUSHED_PARTITION_START = Time.utc(2008, 1, 1)
STARS_TAIL_STEP = 1000000_i64
STATS_ROLLING_WINDOW = 30.days
TOP_TOPICS_LIMIT = 40
USER_AGENT = "crystal-community-github-crystal-stats"
Constructors
new(options : Options)
Source