Background
Existing metrics use the legacy EventLogging system, with its own schema. There was a Grafana dashboard but it is now marked for cleanup. This task is about creating new instrumentation for CodeMirror 6, starting from a clean slate. This data will help us evaluate which features are the most popular, and influence what is decided as the default set of features in the longer-term goal of having CodeMirror on by default for interest projects (i.e. T288161).
As part of this task, we should retire the older instrumentation.
Data questions
- How many people are using CodeMirror?
- Which editors are being used with CodeMirror (2017 editor, WikiEditor, or standalone CodeMirror)?
- Which CodeMirror features are being used?
- What is the relationship of editor experience and the various features? (edit count bucketing)
Implementation
We will use the existing VisualEditorFeatureUse schema, despite it also being "legacy". This is to keep editing-related metrics in one place.
What we're trying to do is very similar to what was done for Realtime Preview (T306176).
We will use the new feature name codemirror, which has the following actions:
- activated – when CodeMirror is activated by any means
- deactivated – when CodeMirror is toggled off
- search – when the CodeMirrorSearch panel is opened
- keymap – when the keyboard shortcut dialog is opened
- prefs-display – when the CodeMirrorPreferences panel is opened
- prefs-activeLine – when the activeLine extension is applied
- prefs-bidiIsolation
- prefs-bracketMatching
- prefs-lineNumbering
- prefs-lineWrapping
- prefs-specialChars
- prefs-codeFolding
- prefs-autocomplete
- prefs-openLinks
After the code is merged, the FeatureUse data dictionary needs to be updated accordingly.