It should be possible to add the generated metrics to the base `Glean` class, using it like a namespace, by using [extensions](https://docs.swift.org/swift-book/LanguageGuide/Extensions.html). According to the docs for extensions, we can add new nested types, which would mean we could generate something like: ```Swift extension Glean { internal enum GleanInternalMetrics { /// The name of the operating system. static let os = StringMetricType( category: "", name: "os", sendInPings: ["glean_client_info"], lifetime: .application, disabled: false ) ... } } ```
Bug 1582133 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
It should be possible to add the generated metrics to the base `Glean` class, using it like a namespace, by using [extensions](https://docs.swift.org/swift-book/LanguageGuide/Extensions.html). According to the docs for extensions, we can add new nested types, which would mean we could generate something like: ```Swift extension Glean { internal enum GleanInternalMetrics { /// The name of the operating system. static let os = StringMetricType( category: "", name: "os", sendInPings: ["glean_client_info"], lifetime: .application, disabled: false ) ... } } ``` Or we could create a new base class like a struct/enum, but it would have to be named something other than `Glean` to prevent clashing with the Glean internal API class.