Skip to content

Commit c610e1e

Browse files
committed
Expose quantity for Qt and add doc about this step
1 parent bd81a37 commit c610e1e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/adding_a_new_metric_type.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class StringMetric extends Metric<string, string> {
9090
}
9191
```
9292

93-
Oce you have your `Metric` subclass, include it in Glean.js'
93+
Once you have your `Metric` subclass, include it in Glean.js'
9494
[`METRIC_MAP`](https://github.com/mozilla/glean.js/blob/main/glean/src/core/metrics/utils.ts#L17).
9595
This map will be used as a template for creating metric instances from the metrics database.
9696

@@ -112,6 +112,10 @@ Still, metric type classes will always have at least one recording function and
112112
> Make sure that, when you included your `Metric` class on the `METRIC_MAP` the property has the
113113
> same value as the `type` property on the corresponding `MetricType`.
114114
115+
Once you are done implementing the `MetricType` class for your new metric type,
116+
make sure to manually expose it for Qt platforms by adding it to
117+
[the Qt entry point file](https://github.com/mozilla/glean.js/blob/main/glean/src/index/qt.ts).
118+
115119
#### Recording functions
116120

117121
_Functions that call Glean.js' database and store concrete values of a metric type._

glean/src/index/qt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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";
1616
import LabeledMetricType from "../core/metrics/types/labeled.js";
17+
import QuantityMetricType from "../core/metrics/types/quantity.js";
1718
import StringMetricType from "../core/metrics/types/string.js";
1819
import TimespanMetricType from "../core/metrics/types/timespan.js";
1920
import UUIDMetricType from "../core/metrics/types/uuid.js";

0 commit comments

Comments
 (0)