Page MenuHomePhabricator

Automate SQL queries for quarterly Phabricator statistics/metrics for Technical Community Newsletter
Closed, ResolvedPublic

Description

Event Timeline

Aklapper triaged this task as Medium priority.

Change 922836 had a related patch set uploaded (by Aklapper; author: Aklapper):

[operations/puppet@production] Automate quarterly Phabricator metrics for Tech Community Newsletter

https://gerrit.wikimedia.org/r/922836

Change 922836 merged by Dzahn:

[operations/puppet@production] Automate quarterly Phabricator metrics for Tech Community Newsletter

https://gerrit.wikimedia.org/r/922836

Change 928943 had a related patch set uploaded (by Dzahn; author: Dzahn):

[operations/puppet@production] Revert "Revert "Automate quarterly Phabricator metrics for Tech Community Newsletter""

https://gerrit.wikimedia.org/r/928943

Change 928943 merged by Dzahn:

[operations/puppet@production] Revert "Revert "Automate quarterly Phabricator metrics for Tech Community Newsletter""

https://gerrit.wikimedia.org/r/928943

Change 929417 had a related patch set uploaded (by Dzahn; author: Dzahn):

[operations/puppet@production] phabricator: try to fix month range format for quartely timer

https://gerrit.wikimedia.org/r/929417

Change 929417 merged by Dzahn:

[operations/puppet@production] phabricator: try to fix month range format for quartely timer

https://gerrit.wikimedia.org/r/929417

Change 929423 had a related patch set uploaded (by Dzahn; author: Dzahn):

[operations/puppet@production] phabricator: replace cut with sed in quarterly_metrics.sh

https://gerrit.wikimedia.org/r/929423

Change 929423 merged by Dzahn:

[operations/puppet@production] phabricator: replace cut with sed in quarterly_metrics.sh

https://gerrit.wikimedia.org/r/929423

@Aklapper After follow-ups above, I think it's working :)

*  [[mw:Phabricator|Phabricator]]: Number of tasks created in Q2/2023: 8098
* Phabricator: Number of tasks closed in Q2/2023: 7868
...

See your inbox now.

@Dzahn: Thanks a lot for fiddling with the systemd/cron parts! Resolving as the test email contains all expected data.

For verification of query syntax and data,

  • ran manually SELECT COUNT(dateCreated) FROM phabricator_maniphest.maniphest_task WHERE dateCreated >= 1677628800; (that's the epoch for 2023-03-01T00:00:00UTC) and result is 8125.
  • ran script's SELECT COUNT(dateCreated) FROM phabricator_maniphest.maniphest_task WHERE FROM_UNIXTIME(dateCreated,'%Y%m')>=DATE_FORMAT(NOW() - INTERVAL 3 MONTH,'%Y%m'); and result is also 8125.

As the script is triggered on the first of every three month, the results will be correct.

Reminder to myself: Create followup task so I'm not the only person receiving this because bus factor

Confirming that this worked as expected on 1st July (and data was copied as expected)