Skip to content

usage-stats: build DDEV commands breakdown from filtered live data#690

Open
rfay wants to merge 1 commit into
ddev:mainfrom
rfay:20260723_ddev_drush
Open

usage-stats: build DDEV commands breakdown from filtered live data#690
rfay wants to merge 1 commit into
ddev:mainfrom
rfay:20260723_ddev_drush

Conversation

@rfay

@rfay rfay commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

The usage-stats "DDEV Commands" section previously rendered a saved Amplitude chart whose allow-list excluded drush and was polluted with site-specific custom command names. This replaces that with an ad hoc Events Segmentation query filtered in code against a version-controlled list of documented DDEV commands.

  • New getCommandUsage() in src/lib/amplitude.ts queries the Command event grouped by Command Name (totals, last 7 days) and filters to DDEV_COMMANDS — the built-in commands documented at docs.ddev.com.
  • Drops the custom-command aggregate, undocumented/legacy names, and second-level sub-args tracked as their own name (e.g. pantheon/acquia from ddev pull), while including drush.
  • Filter now lives in code as a single, reviewable source of truth — no Amplitude saved chart or allow-list to maintain.
  • Shows the top 20 commands as bars plus an expandable full table of all documented commands with usage, mirroring the Add-on Usage section.
  • Removes the now-unused saved chart entry and its share link, plus a matching sample-data fallback for credential-less builds.

Notes

  • pull/push don't appear in the list because Amplitude records them under the provider sub-arg (pantheon, acquia, platform, upsun, lagoon), which already have the dedicated "Bundled ddev pull Usage" section.

Test plan

🤖 Generated with Claude Code

The commands section previously rendered a saved Amplitude chart whose
allow-list excluded `drush` and was polluted with site-specific custom
command names. Replace it with an ad hoc Events Segmentation query
(Command event grouped by Command Name, totals, last 7 days) filtered in
code to a version-controlled list of documented ddev commands
(DDEV_COMMANDS, from docs.ddev.com). This drops the custom-command
aggregate, undocumented/legacy names, and second-level sub-args tracked
as their own name (e.g. pantheon/acquia from `ddev pull`), while
including drush.

Show the top 20 as bars plus an expandable full table of all documented
commands with usage, mirroring the Add-on Usage section. Drop the
now-unused saved chart and its share link.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🌐 Fork Preview for PR #690

https://pr-690.ddev-com-fork-previews.pages.dev

This preview updates automatically when you push changes to your fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant