Page MenuHomePhabricator

Wikifunctions metrics: Track inventory of functions, implementations, tests
Closed, ResolvedPublic

Description

Description

Arrange to periodically count up functions/implementations/tests in Wikifunctions content, and make the counts available for dashboarding. Initially, these counts will be obtained from wikilambda_zobject_function_join and wikilambda_zobject_labels tables.


Completion checklist

Event Timeline

Jdforrester-WMF changed the task status from Open to In Progress.Jul 28 2023, 4:07 PM
Jdforrester-WMF triaged this task as High priority.

@DMartin-WMF
I confirmed I could query both of these sqoop'd tables with hive and with presto in superset. They are found under the following table names: wmf_raw.wikilambda_zobject_labels and wmf_raw.wikilambda_zobject_labels. All data currently appears to be logging as expected.

Some example queries and results below for reference. Data reflects daily snapshot recorded on '07 August 2023' Note: These queries are written based on the documentation in the instrumentation spec. Let me know if the results seem unexpected or any adjustments are needed.

Number of functions created
180

--Count distinct values of wlzl_zobject_zid, where wlzl_type = 'Z8'
SELECT 
COUNT (DISTINCT wlzl_zobject_zid) as n_functions_created
FROM
wmf_raw.wikilambda_zobject_labels
WHERE 
snapshot = 'latest'
AND 
wlzl_type = 'Z8'

Number of implementations created
222

Number of tests created
294

--Count values of wlzf_ref_zid, where where wlzf_type = 'Z14' (implementation) or wlzf_type = 'Z20' (test)
SELECT 
wlzf_type,
COUNT (DISTINCT wlzf_ref_zid)
FROM
wmf_raw.wikilambda_zobject_function_join
WHERE 
snapshot = 'latest'
GROUP BY
wlzf_type