Skip to content

Commit d9d2686

Browse files
Dexterp37badboy
andauthored
Expose the missing metrics on the QT platform (#273)
* Update the README to use virtual environments * Fix a typo in a comment * Export the missing labeled and timespan types * Add a changelog entry * Apply suggestions from code review Co-authored-by: Jan-Erik Rediger <badboy@archlinux.us> Co-authored-by: Jan-Erik Rediger <badboy@archlinux.us>
1 parent e339205 commit d9d2686

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Implement the timespan metric type.
99
* BUGFIX: Report event timestamps in milliseconds.
1010
* [#261](https://github.com/mozilla/glean.js/pull/261): Show a spinner while setting up python virtual environment
11+
* [#273](https://github.com/mozilla/glean.js/pull/273): BUGFIX: Expose the missing `LabeledMetricType` and `TimespanMetricType` in Qt.
1112

1213
# v0.10.2 (2021-04-26)
1314

glean/src/index/qt.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import BooleanMetricType from "../core/metrics/types/boolean.js";
1313
import CounterMetricType from "../core/metrics/types/counter.js";
1414
import DatetimeMetricType from "../core/metrics/types/datetime.js";
1515
import EventMetricType from "../core/metrics/types/event.js";
16+
import LabeledMetricType from "../core/metrics/types/labeled.js";
1617
import StringMetricType from "../core/metrics/types/string.js";
18+
import TimespanMetricType from "../core/metrics/types/timespan.js";
1719
import UUIDMetricType from "../core/metrics/types/uuid.js";
1820

1921
export default {
@@ -129,7 +131,9 @@ export default {
129131
CounterMetricType,
130132
DatetimeMetricType,
131133
EventMetricType,
134+
LabeledMetricType,
132135
StringMetricType,
136+
TimespanMetricType,
133137
UUIDMetricType
134138
}
135139
};

glean/src/platform/qt/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
// Qt does not have its implementations yet,
6-
// we leavet his here so that the sample will still work.
6+
// we leave this here so that the sample will still work.
77
export { default } from "../test";

samples/qt-qml-app/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,28 @@ The app will display a button that when clicked should trigger Glean.js events.
1313
npm run build:qt
1414
```
1515

16+
2. Whithin this sample directory, run the command to create a Python 3 virtual environment.
17+
18+
```bash
19+
python3 -m venv .venv
20+
```
21+
1622
2. Install the dependencies.
1723

1824
```bash
19-
pip install -r requirements.txt
25+
.venv/bin/pip3 install -r requirements.txt
2026
```
2127

2228
3. Generate metrics and pings files.
2329

2430
```bash
25-
glean_parser translate metrics.yaml pings.yaml -f javascript -o generated --option platform=qt
31+
.venv/bin/python3 -m glean_parser translate metrics.yaml pings.yaml -f javascript -o generated --option platform=qt
2632
```
2733

2834
4. Run the application.
2935

3036
```bash
31-
python main.py
37+
.venv/bin/python3 main.py
3238
```
39+
40+
> *Important*: if running the application fails, turn on Qt debugging by setting the `QT_DEBUG_PLUGINS` environment variable to `1`, e.g. `export QT_DEBUG_PLUGINS=1`.

0 commit comments

Comments
 (0)