codefloe/analytics
Watch
2
5
Fork
You've already forked analytics
0
Usage Analytics for CodeFloe
  • R 99.2%
  • Just 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-27 12:32:15 +00:00
docs/superpowers/plans Add generated cost report outputs 2026-05-01 14:20:57 +02:00
invoices feat(cost): add cost pipeline with batch processing support 2026-05-01 13:13:45 +02:00
R feat(cost): allocate shared infrastructure costs 2026-08-29 11:16:29 +02:00
renv chore: update renv.lock 2026-06-30 21:08:05 +02:00
reports chore: add 2026-q3 report 2026-09-30 23:34:42 +02:00
tests feat(cost): allocate shared infrastructure costs 2026-08-29 11:16:29 +02:00
.ecrc init 2025-12-25 10:15:59 +01:00
.editorconfig init 2025-12-25 10:15:59 +01:00
.gitignore feat(cost): add cost pipeline with batch processing support 2026-05-01 13:13:45 +02:00
.gitleaksignore init 2025-12-25 10:15:59 +01:00
.markdownlint.yaml feat(cost): allocate shared infrastructure costs 2026-08-29 11:16:29 +02:00
.markdownlintignore feat(cost): allocate shared infrastructure costs 2026-08-29 11:16:29 +02:00
.pre-commit-config.yaml style: apply pre-commit whitespace and end-of-file fixes 2026-11-27 13:28:12 +01:00
.prettierrc.json init 2025-12-25 10:15:59 +01:00
.Rbuildignore Add generated cost report outputs 2026-05-01 14:20:57 +02:00
.Rprofile init 2025-12-25 10:15:59 +01:00
.yamllint.yaml init 2025-12-25 10:15:59 +01:00
_targets.R feat: add 2026-2 report 2026-06-30 21:49:29 +02:00
_targets_cost.R feat(cost): allocate shared infrastructure costs 2026-08-29 11:16:29 +02:00
CLAUDE.md style: apply pre-commit whitespace and end-of-file fixes 2026-11-27 13:28:12 +01:00
DESCRIPTION feat(cost): add Hetzner invoice CSV parser with German locale support 2026-05-01 13:13:42 +02:00
justfile feat: add justfile for running reports and tests 2026-05-01 13:13:47 +02:00
README.md chore: add 2026-q3 report 2026-09-30 23:34:42 +02:00
renovate.json init 2025-12-25 10:15:59 +01:00
renv.lock chore: update renv.lock 2026-06-30 21:08:05 +02:00

Codefloe Platform Analytics

Quarterly analytics for the codefloe.com Forgejo platform. Generates anonymous usage metrics for users, repositories, organizations, and packages with quarter-over-quarter comparison.

Reports

Platform Analytics

2025
2026

Infrastructure Costs

2025
2026

Prerequisites

  • R 4.5+
  • Forgejo admin API access
  • Hetzner S3 bucket for data persistence

Setup

  1. Install dependencies

    R -e 'renv::restore()'
    
  2. Configure environment variables

    Create .Renviron (R reads this automatically, including in targets workers):

    FORGEJO_ADMIN_TOKEN=your_token_here
    AWS_ACCESS_KEY_ID=your_access_key
    AWS_SECRET_ACCESS_KEY=your_secret_key
    

    Optional overrides:

    FORGEJO_BASE_URL=https://codefloe.com
    S3_BUCKET=prod-analytics
    S3_ENDPOINT=https://fsn1.your-objectstorage.com
    S3_REGION=fsn1
    

Usage

Run for current quarter

R -e 'targets::tar_make()'

Run for a specific quarter

ANALYTICS_QUARTER=2025-Q1 R -e 'targets::tar_make()'

View pipeline graph

R -e 'targets::tar_visnetwork()'

Check pipeline status

R -e 'targets::tar_progress()'

Force regenerate report

To regenerate the report without refetching data:

R -e "targets::tar_invalidate(c('report', 'report_images')); targets::tar_make()"

Force full refresh

To refetch all data and regenerate everything:

R -e "targets::tar_invalidate(targets::tar_objects()); targets::tar_make()"

Infrastructure Cost Reports

Monthly cost reports based on Hetzner invoice CSVs. Covers dedicated servers and all "Projekt codefloe" cloud resources.

Dedicated servers fall into two groups:

  • Exclusive (artemis, and the retired hades, minerva, demeter): charged at full price. The retired ones stay in the list so invoices from before July 2026 still resolve.
  • Shared Proxmox VE hosts (zeus, hera, apollo, poseidon): these run VMs for several projects, so only codefloe's share of every host-related invoice line is counted, including IPv4 and uplink add-ons. The share per host is the sum over its codefloe VMs of max(vCPU / host threads, RAM / host RAM), giving zeus 25%, hera 37.5%, apollo 25% and poseidon 75%. Shares live in codefloe_shared_hosts() in R/cost_parse.R and must be kept in sync with the live Proxmox VM configuration and the hardware table in the codefloe docs. Costs are broken down by environment (prod/dev) and server type (k8s cluster/single). Reports also include completed Liberapay payments from the public team payment history, net of reported reversals. Payments are summed by month in their original currencies and converted to EUR using the ECB reference rate from the payment date, or the preceding business day. Donor-level fields are discarded during retrieval and are never stored or displayed.

Running cost reports

  1. Download the monthly invoice CSV(s) from Hetzner
  2. Drop them into the invoices/ directory
  3. Run the cost pipeline:
R -e 'targets::tar_make(script = "_targets_cost.R", store = "_targets_cost")'

Multiple CSVs can be dropped at once for batch processing. Reports are generated in reports/costs/<YYYY-MM>/.

To force re-processing, delete _targets_cost/ and re-run.

Output

Quarterly analytics reports: reports/<quarter>/quarterly_report.md Monthly cost reports: reports/costs/<YYYY-MM>/cost_report.md

Metrics Collected

Users

  • Total count, new registrations
  • Public/private visibility split
  • Active users, admin users

Repositories

  • Total count, new repos
  • Public/private split
  • Forks, mirrors, archived repos
  • Total stars, forks, size

Organizations

  • Total count
  • Public/private split
  • Total repos and members

Packages

  • Total count, new packages
  • Public/private split
  • Breakdown by package type

Data Storage

Raw data is uploaded to S3 after each run, organized by quarter:

s3://prod-analytics/
├── 2025-Q1/
│   ├── users.csv
│   ├── repos.csv
│   ├── orgs.csv
│   └── packages.csv
├── 2025-Q2/
│   └── ...

Previous quarter data is automatically loaded for comparison. The first run will report absolute numbers only.

Anonymization

  • No usernames, emails, or repository names are collected
  • Only aggregate counts and metadata are stored
  • Private repository/org names are never exposed