glean-parser 20.2.0__tar.gz → 21.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glean_parser-20.2.0 → glean_parser-21.0.1}/PKG-INFO +1 -1
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/schemas/metrics.2-0-0.schema.yaml +1 -1
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/kotlin.jinja2 +56 -5
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/swift.jinja2 +63 -5
- glean_parser-21.0.1/tests/data/categories.yaml +28 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/schema-violation.yaml +4 -1
- glean_parser-21.0.1/tests/data/single_labeled.yaml +67 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_kotlin.py +32 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_parser.py +31 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_swift.py +30 -0
- glean_parser-20.2.0/tests/data/single_labeled.yaml +0 -21
- {glean_parser-20.2.0 → glean_parser-21.0.1}/.gitignore +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/AUTHORS.md +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/LICENSE +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/README.md +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/__init__.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/__main__.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/data_review.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/go_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/javascript.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/javascript_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/kotlin.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/lint.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/markdown.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/metrics.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/parser.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/pings.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/python_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/ruby_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/rust.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/rust_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/rust_sym.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/schemas/metrics.1-0-0.schema.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/schemas/pings.1-0-0.schema.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/schemas/pings.2-0-0.schema.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/schemas/tags.1-0-0.schema.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/swift.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/tags.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/data_review.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/go_server.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/javascript.buildinfo.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/javascript.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/javascript_server.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/kotlin.buildinfo.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/markdown.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/python_server.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/qmldir.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/ruby_server.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/rust.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/rust_server.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/rust_sym.jinja2 +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/translate.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/translation_options.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/util.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/validate_ping.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/pyproject.toml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/server_telemetry/sdk-metrics-compat.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/server_telemetry/server-side-pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/conftest.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/all_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/all_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/attribution.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/bad_attribution.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/bad_ping.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/core.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/custom_ping_no_event_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/custom_ping_no_event_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/dual_labeled.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/dual_labeled_invalid.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/duplicate_labeled.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/duplicate_send_in_ping.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/empty.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/event_key_ordering.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/events_data_sensitivity.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/events_with_types.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/fxa-server-metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/fxa-server-pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_custom_ping_only_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_custom_ping_only_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_events_and_custom_ping_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_events_and_custom_ping_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_events_only_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_labeled_boolean_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_metrics_unsupported.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/invalid-ping-names.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/invalid.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/jwe.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/metric-with-tags.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/mixed-expirations.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/name_too_similar.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/object.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/old_event_api.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/ordering.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/python_server_metrics_unsupported.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rate.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/redefined_category.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/redefined_metric.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/redefined_ping.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/reserved_categories.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/ruby_server_metrics_unsupported.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/ruby_server_pings_unsupported.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_custom_ping_only_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_custom_ping_only_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_events_and_custom_ping_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_events_and_custom_ping_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_events_only_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_metrics_unsupported.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/same_name_different_category.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/send_if_empty_with_metrics.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_custom_ping_only_compare.go +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_custom_ping_only_compare.rs +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_and_custom_ping_compare.go +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_and_custom_ping_compare.rs +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_compare.rb +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_only_compare.go +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_only_compare.rs +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_metrics_no_events_no_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_metrics_with_event.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_pings.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/smaller.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/tags.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/telemetry_mirror.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/text.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/text_invalid.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/unknown_ping_used.yaml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/wrong_key.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/yaml_nits.yamlx +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/detekt.yml +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-go/test.go.tmpl +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-go/test_publisher.go.tmpl +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-js/package.json +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-js/test.js.tmpl +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-py/test.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-rb/test.rb.tmpl +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test-rs/test.rs.tmpl +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_cli.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_go_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_go_server_pubsub.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_javascript.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_javascript_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_lint.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_markdown.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_metrics.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_pings.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_python_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_ruby_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_rust.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_rust_server.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_rust_sym.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_tags.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_translate.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_utils.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/test_validate_ping.py +0 -0
- {glean_parser-20.2.0 → glean_parser-21.0.1}/tests/util.py +0 -0
|
@@ -289,6 +289,10 @@ import {{ glean_namespace }}.private.{{ obj_type }} // ktlint-disable import-ord
|
|
|
289
289
|
{% endfor %}
|
|
290
290
|
{% if has_labeled_metrics %}
|
|
291
291
|
import {{ glean_namespace }}.private.LabeledMetricType // ktlint-disable import-ordering
|
|
292
|
+
import {{ glean_namespace }}.private.CommonLabeledMetricData // ktlint-disable import-ordering no-unused-imports
|
|
293
|
+
import {{ glean_namespace }}.private.CustomDistributionLabeledMetricData // ktlint-disable import-ordering no-unused-imports
|
|
294
|
+
import {{ glean_namespace }}.private.MemoryDistributionLabeledMetricData // ktlint-disable import-ordering no-unused-imports
|
|
295
|
+
import {{ glean_namespace }}.private.TimingDistributionLabeledMetricData // ktlint-disable import-ordering no-unused-imports
|
|
292
296
|
{% endif %}
|
|
293
297
|
{% if has_object_metrics %}
|
|
294
298
|
import {{ glean_namespace }}.private.intoSerializedObject
|
|
@@ -344,12 +348,59 @@ internal object {{ category_name|Camelize }} {
|
|
|
344
348
|
*/
|
|
345
349
|
val {{ obj.name|camelize }}: LabeledMetricType<{{ obj|type_name }}> by lazy { // generated from {{ obj.identifier() }}
|
|
346
350
|
LabeledMetricType(
|
|
347
|
-
|
|
348
|
-
|
|
351
|
+
{% if obj.type == "labeled_custom_distribution" %}
|
|
352
|
+
CustomDistributionLabeledMetricData(
|
|
353
|
+
cmd = CommonMetricData(
|
|
354
|
+
category = {{ obj.category|kotlin }},
|
|
355
|
+
name = {{ obj.name|kotlin }},
|
|
356
|
+
disabled = {{ obj.is_disabled()|kotlin }},
|
|
357
|
+
lifetime = {{ obj.lifetime|kotlin }},
|
|
358
|
+
sendInPings = {{ obj.send_in_pings|kotlin }}
|
|
359
|
+
)
|
|
360
|
+
{%- for arg_name in extra_metric_args if obj[arg_name] is defined -%}
|
|
361
|
+
, {{ arg_name|camelize }} = {{ obj[arg_name]|kotlin }}
|
|
362
|
+
{%- endfor -%}
|
|
363
|
+
),
|
|
364
|
+
{% elif obj.type == "labeled_memory_distribution" %}
|
|
365
|
+
MemoryDistributionLabeledMetricData(
|
|
366
|
+
cmd = CommonMetricData(
|
|
367
|
+
category = {{ obj.category|kotlin }},
|
|
368
|
+
name = {{ obj.name|kotlin }},
|
|
369
|
+
disabled = {{ obj.is_disabled()|kotlin }},
|
|
370
|
+
lifetime = {{ obj.lifetime|kotlin }},
|
|
371
|
+
sendInPings = {{ obj.send_in_pings|kotlin }}
|
|
372
|
+
)
|
|
373
|
+
{%- for arg_name in extra_metric_args if obj[arg_name] is defined -%}
|
|
374
|
+
, {{ arg_name|camelize }} = {{ obj[arg_name]|kotlin }}
|
|
375
|
+
{%- endfor -%}
|
|
376
|
+
),
|
|
377
|
+
{% elif obj.type == "labeled_timing_distribution" %}
|
|
378
|
+
TimingDistributionLabeledMetricData(
|
|
379
|
+
cmd = CommonMetricData(
|
|
380
|
+
category = {{ obj.category|kotlin }},
|
|
381
|
+
name = {{ obj.name|kotlin }},
|
|
382
|
+
disabled = {{ obj.is_disabled()|kotlin }},
|
|
383
|
+
lifetime = {{ obj.lifetime|kotlin }},
|
|
384
|
+
sendInPings = {{ obj.send_in_pings|kotlin }}
|
|
385
|
+
)
|
|
386
|
+
{%- for arg_name in extra_metric_args if obj[arg_name] is defined -%}
|
|
387
|
+
, {{ arg_name|camelize }} = {{ obj[arg_name]|kotlin }}
|
|
388
|
+
{%- endfor -%}
|
|
389
|
+
),
|
|
390
|
+
{% elif obj.labeled %}
|
|
391
|
+
CommonLabeledMetricData(
|
|
392
|
+
cmd = CommonMetricData(
|
|
393
|
+
category = {{ obj.category|kotlin }},
|
|
394
|
+
name = {{ obj.name|kotlin }},
|
|
395
|
+
disabled = {{ obj.is_disabled()|kotlin }},
|
|
396
|
+
lifetime = {{ obj.lifetime|kotlin }},
|
|
397
|
+
sendInPings = {{ obj.send_in_pings|kotlin }}
|
|
398
|
+
)
|
|
399
|
+
),
|
|
400
|
+
{% else %}
|
|
401
|
+
UNKNOWN
|
|
402
|
+
{% endif %}
|
|
349
403
|
subMetric = {{ obj.name|camelize }}Label,
|
|
350
|
-
disabled = {{ obj.is_disabled()|kotlin }},
|
|
351
|
-
lifetime = {{ obj.lifetime|kotlin }},
|
|
352
|
-
sendInPings = {{ obj.send_in_pings|kotlin }},
|
|
353
404
|
labels = {{ obj.labels|kotlin }}
|
|
354
405
|
)
|
|
355
406
|
}
|
|
@@ -217,11 +217,69 @@ extension {{ namespace }} {
|
|
|
217
217
|
{{ obj_declaration(obj, 'Label', 'private ') | indent }}
|
|
218
218
|
/// {{ obj.description|wordwrap() | replace('\n', '\n /// ') }}
|
|
219
219
|
static let {{ obj.name|camelize|variable_name }} = try! LabeledMetricType<{{ obj|type_name }}>( // generated from {{ obj.identifier() }}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
{% if obj.type == "labeled_custom_distribution" %}
|
|
221
|
+
.customDistribution(
|
|
222
|
+
cmd: CommonMetricData(
|
|
223
|
+
category: {{ obj.category|swift }},
|
|
224
|
+
name: {{ obj.name|swift }},
|
|
225
|
+
sendInPings: {{ obj.send_in_pings|swift }},
|
|
226
|
+
lifetime: {{ obj.lifetime|swift }},
|
|
227
|
+
disabled: {{ obj.is_disabled()|swift }},
|
|
228
|
+
)
|
|
229
|
+
{% for arg_name in extra_metric_args if obj[arg_name] is defined %}
|
|
230
|
+
, {{arg_name|camelize}}: {{ obj[arg_name]|swift }}
|
|
231
|
+
{% endfor %}
|
|
232
|
+
),
|
|
233
|
+
{% elif obj.type == "labeled_memory_distribution" %}
|
|
234
|
+
.memoryDistribution(
|
|
235
|
+
cmd: CommonMetricData(
|
|
236
|
+
category: {{ obj.category|swift }},
|
|
237
|
+
name: {{ obj.name|swift }},
|
|
238
|
+
sendInPings: {{ obj.send_in_pings|swift }},
|
|
239
|
+
lifetime: {{ obj.lifetime|swift }},
|
|
240
|
+
disabled: {{ obj.is_disabled()|swift }},
|
|
241
|
+
)
|
|
242
|
+
{% for arg_name in extra_metric_args if obj[arg_name] is defined %}
|
|
243
|
+
{% if arg_name == "memory_unit" %}
|
|
244
|
+
, unit: {{ obj[arg_name]|swift }}
|
|
245
|
+
{% else %}
|
|
246
|
+
, {{arg_name|camelize}}: {{ obj[arg_name]|swift }}
|
|
247
|
+
{% endif %}
|
|
248
|
+
{% endfor %}
|
|
249
|
+
),
|
|
250
|
+
{% elif obj.type == "labeled_timing_distribution" %}
|
|
251
|
+
.timingDistribution(
|
|
252
|
+
cmd: CommonMetricData(
|
|
253
|
+
category: {{ obj.category|swift }},
|
|
254
|
+
name: {{ obj.name|swift }},
|
|
255
|
+
sendInPings: {{ obj.send_in_pings|swift }},
|
|
256
|
+
lifetime: {{ obj.lifetime|swift }},
|
|
257
|
+
disabled: {{ obj.is_disabled()|swift }},
|
|
258
|
+
)
|
|
259
|
+
{% for arg_name in extra_metric_args if obj[arg_name] is defined %}
|
|
260
|
+
{% if arg_name == "time_unit" %}
|
|
261
|
+
, unit: {{ obj[arg_name]|swift }}
|
|
262
|
+
{% else %}
|
|
263
|
+
, {{arg_name|camelize}}: {{ obj[arg_name]|swift }}
|
|
264
|
+
{% endif %}
|
|
265
|
+
{% endfor %}
|
|
266
|
+
),
|
|
267
|
+
{% elif obj.labeled %}
|
|
268
|
+
.common(
|
|
269
|
+
cmd: CommonMetricData(
|
|
270
|
+
category: {{ obj.category|swift }},
|
|
271
|
+
name: {{ obj.name|swift }},
|
|
272
|
+
sendInPings: {{ obj.send_in_pings|swift }},
|
|
273
|
+
lifetime: {{ obj.lifetime|swift }},
|
|
274
|
+
disabled: {{ obj.is_disabled()|swift }},
|
|
275
|
+
)
|
|
276
|
+
{% for arg_name in extra_metric_args if obj[arg_name] is defined %}
|
|
277
|
+
, {{arg_name|camelize}}: {{ obj[arg_name]|swift }}
|
|
278
|
+
{% endfor %}
|
|
279
|
+
),
|
|
280
|
+
{% else %}
|
|
281
|
+
UNKNOWN
|
|
282
|
+
{% endif %}
|
|
225
283
|
subMetric: {{ obj.name|camelize }}Label,
|
|
226
284
|
labels: {{ obj.labels|swift }}
|
|
227
285
|
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Any copyright is dedicated to the Public Domain.
|
|
2
|
+
# https://creativecommons.org/publicdomain/zero/1.0/
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
we_used_to_have_subcategory_length:
|
|
9
|
+
but_we_dont_any_more: &defaults
|
|
10
|
+
type: counter
|
|
11
|
+
expires: never
|
|
12
|
+
description: A test metric
|
|
13
|
+
bugs: [https://bugzil.la/2062403]
|
|
14
|
+
data_reviews: [https://www.example.com]
|
|
15
|
+
notification_emails: [glean-team@mozilla.com]
|
|
16
|
+
|
|
17
|
+
it.may_matter_that_theres_a_dot_here:
|
|
18
|
+
so_we_will_test_that_too:
|
|
19
|
+
<<: *defaults
|
|
20
|
+
|
|
21
|
+
# Subcategory length 30, Category length 40
|
|
22
|
+
start.abcdefghijklmnopqrstuvwxyzabcd.end:
|
|
23
|
+
no_problem:
|
|
24
|
+
<<: *defaults
|
|
25
|
+
|
|
26
|
+
a.b:
|
|
27
|
+
really_short_categories_are_allowed:
|
|
28
|
+
<<: *defaults
|
|
@@ -19,7 +19,7 @@ gleantest.lifetime:
|
|
|
19
19
|
expires: never
|
|
20
20
|
data_reviews: ['http://example.com']
|
|
21
21
|
gleantest.with.way.too.long.category.name:
|
|
22
|
-
test_event_inv_lt:
|
|
22
|
+
test_event_inv_lt: &valid_metric
|
|
23
23
|
description: A test metric
|
|
24
24
|
type: boolean
|
|
25
25
|
bugs:
|
|
@@ -27,6 +27,9 @@ gleantest.with.way.too.long.category.name:
|
|
|
27
27
|
notification_emails: ['nobody@example.com']
|
|
28
28
|
expires: never
|
|
29
29
|
data_reviews: ['http://example.com']
|
|
30
|
+
gleantest_with_way_too_long_category_name_and_no_subcategories:
|
|
31
|
+
test_metric:
|
|
32
|
+
<<: *valid_metric
|
|
30
33
|
gleantest.short.category:
|
|
31
34
|
very_long_metric_name_this_is_too_long_as_well_since_it_has_sooooo_many_characters:
|
|
32
35
|
description: A test metric
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Any copyright is dedicated to the Public Domain.
|
|
2
|
+
# https://creativecommons.org/publicdomain/zero/1.0/
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
|
6
|
+
|
|
7
|
+
no_lint:
|
|
8
|
+
- EXPIRATION_DATE_TOO_FAR
|
|
9
|
+
|
|
10
|
+
category:
|
|
11
|
+
labeled_counter: &defaults
|
|
12
|
+
type: labeled_counter
|
|
13
|
+
lifetime: ping
|
|
14
|
+
description: >
|
|
15
|
+
Foo
|
|
16
|
+
bugs:
|
|
17
|
+
- https://bugzilla.mozilla.org/11137353
|
|
18
|
+
data_reviews:
|
|
19
|
+
- http://example.com/reviews
|
|
20
|
+
notification_emails:
|
|
21
|
+
- CHANGE-ME@example.com
|
|
22
|
+
send_in_pings:
|
|
23
|
+
- core
|
|
24
|
+
expires: 2100-01-01
|
|
25
|
+
|
|
26
|
+
labeled_boolean:
|
|
27
|
+
<<: *defaults
|
|
28
|
+
type: labeled_boolean
|
|
29
|
+
|
|
30
|
+
labeled_string:
|
|
31
|
+
<<: *defaults
|
|
32
|
+
type: labeled_string
|
|
33
|
+
|
|
34
|
+
labeled_custom_distribution:
|
|
35
|
+
<<: *defaults
|
|
36
|
+
type: labeled_custom_distribution
|
|
37
|
+
range_min: 0
|
|
38
|
+
range_max: 100
|
|
39
|
+
bucket_count: 10
|
|
40
|
+
histogram_type: linear
|
|
41
|
+
labels:
|
|
42
|
+
- aLabel
|
|
43
|
+
- 2label
|
|
44
|
+
|
|
45
|
+
labeled_memory_distribution:
|
|
46
|
+
<<: *defaults
|
|
47
|
+
type: labeled_memory_distribution
|
|
48
|
+
memory_unit: kilobyte
|
|
49
|
+
labels:
|
|
50
|
+
- aLabel
|
|
51
|
+
- 2label
|
|
52
|
+
|
|
53
|
+
labeled_timing_distribution:
|
|
54
|
+
<<: *defaults
|
|
55
|
+
type: labeled_timing_distribution
|
|
56
|
+
time_unit: millisecond
|
|
57
|
+
labels:
|
|
58
|
+
- aLabel
|
|
59
|
+
- 2label
|
|
60
|
+
|
|
61
|
+
labeled_quantity:
|
|
62
|
+
<<: *defaults
|
|
63
|
+
type: labeled_quantity
|
|
64
|
+
unit: tabs
|
|
65
|
+
labels:
|
|
66
|
+
- aLabel
|
|
67
|
+
- 2label
|
|
@@ -411,3 +411,35 @@ def test_object_metric(tmp_path):
|
|
|
411
411
|
assert "var moduleIndex: Int? = null," in content
|
|
412
412
|
assert "var ip: String? = null," in content
|
|
413
413
|
assert "var trust: String? = null," in content
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
def test_labeled_metrics(tmp_path):
|
|
417
|
+
"""
|
|
418
|
+
Assert that labeled metrics are created.
|
|
419
|
+
"""
|
|
420
|
+
translate.translate(
|
|
421
|
+
ROOT / "data" / "single_labeled.yaml",
|
|
422
|
+
"kotlin",
|
|
423
|
+
tmp_path,
|
|
424
|
+
{"namespace": "Foo"},
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
assert set(x.name for x in tmp_path.iterdir()) == set(
|
|
428
|
+
["Category.kt", "GleanBuildInfo.kt"]
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
with (tmp_path / "Category.kt").open("r", encoding="utf-8") as fd:
|
|
432
|
+
content = fd.read()
|
|
433
|
+
content = " ".join(content.split())
|
|
434
|
+
|
|
435
|
+
assert "LabeledMetricType<BooleanMetricType>" in content
|
|
436
|
+
assert "CommonMetricData(" in content
|
|
437
|
+
assert "LabeledMetricType<CounterMetricType>" in content
|
|
438
|
+
assert "LabeledMetricType<StringMetricType>" in content
|
|
439
|
+
assert "LabeledMetricType<QuantityMetricType>" in content
|
|
440
|
+
assert "LabeledMetricType<CustomDistributionMetricType>" in content
|
|
441
|
+
assert "CustomDistributionLabeledMetricData(" in content
|
|
442
|
+
assert "LabeledMetricType<TimingDistributionMetricType>" in content
|
|
443
|
+
assert "TimingDistributionLabeledMetricData(" in content
|
|
444
|
+
assert "LabeledMetricType<MemoryDistributionMetricType>" in content
|
|
445
|
+
assert "MemoryDistributionLabeledMetricData(" in content
|
|
@@ -357,6 +357,18 @@ def test_parser_schema_violation():
|
|
|
357
357
|
- `description`: **Required.** A description of the key.
|
|
358
358
|
Valid when `type`_ is `event`.
|
|
359
359
|
""",
|
|
360
|
+
"""
|
|
361
|
+
```
|
|
362
|
+
gleantest_with_way_too_long_category_name_and_no_subcategories
|
|
363
|
+
...
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
'gleantest_with_way_too_long_category_name_and_no_subcategories' is not valid under any of
|
|
367
|
+
the given schemas
|
|
368
|
+
'gleantest_with_way_too_long_category_name_and_no_subcategories' is too long
|
|
369
|
+
'gleantest_with_way_too_long_category_name_and_no_subcategories' is not one of
|
|
370
|
+
['$schema', '$tags']
|
|
371
|
+
""",
|
|
360
372
|
]
|
|
361
373
|
|
|
362
374
|
expected_errors = set(
|
|
@@ -371,6 +383,14 @@ def test_parser_schema_violation():
|
|
|
371
383
|
for found_error, expected_error in zip(found, expected):
|
|
372
384
|
assert found_error == expected_error
|
|
373
385
|
|
|
386
|
+
# If there are new errors and they're sorted after the expected list,
|
|
387
|
+
# the above checks won't find them. Log 'em, then assert 'em.
|
|
388
|
+
if len(found) > len(expected):
|
|
389
|
+
for i in range(len(expected), len(found)):
|
|
390
|
+
print(f"Unexpected error: {found[i]}")
|
|
391
|
+
|
|
392
|
+
assert len(found) == len(expected)
|
|
393
|
+
|
|
374
394
|
|
|
375
395
|
def test_parser_empty():
|
|
376
396
|
"""1507792: Get a good error message if the metrics.yaml file is empty."""
|
|
@@ -1593,3 +1613,14 @@ def test_overriden_expire_epoch_must_be_valid(invalid_epoch):
|
|
|
1593
1613
|
list(all_metrics)
|
|
1594
1614
|
|
|
1595
1615
|
del os.environ["SOURCE_DATE_EPOCH"]
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
def test_categories():
|
|
1619
|
+
"""Test the basics of parsing oddly-named-or-structured categories."""
|
|
1620
|
+
all_metrics = parser.parse_objects(
|
|
1621
|
+
[ROOT / "data" / "categories.yaml"],
|
|
1622
|
+
config={"allow_reserved": False},
|
|
1623
|
+
)
|
|
1624
|
+
|
|
1625
|
+
errs = list(all_metrics)
|
|
1626
|
+
assert len(errs) == 0
|
|
@@ -380,3 +380,33 @@ def test_object_metric(tmp_path):
|
|
|
380
380
|
assert "var moduleIndex: Int64?" in content
|
|
381
381
|
assert "var ip: String?" in content
|
|
382
382
|
assert "var trust: String?" in content
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
def test_labeled_metrics(tmp_path):
|
|
386
|
+
"""
|
|
387
|
+
Assert that labeled metrics are created.
|
|
388
|
+
"""
|
|
389
|
+
translate.translate(
|
|
390
|
+
ROOT / "data" / "single_labeled.yaml",
|
|
391
|
+
"swift",
|
|
392
|
+
tmp_path,
|
|
393
|
+
{"namespace": "Foo"},
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
assert set(x.name for x in tmp_path.iterdir()) == set(["Metrics.swift"])
|
|
397
|
+
|
|
398
|
+
with (tmp_path / "Metrics.swift").open("r", encoding="utf-8") as fd:
|
|
399
|
+
content = fd.read()
|
|
400
|
+
content = " ".join(content.split())
|
|
401
|
+
|
|
402
|
+
assert "LabeledMetricType<BooleanMetricType>" in content
|
|
403
|
+
assert ".common(" in content
|
|
404
|
+
assert "LabeledMetricType<CounterMetricType>" in content
|
|
405
|
+
assert "LabeledMetricType<StringMetricType>" in content
|
|
406
|
+
assert "LabeledMetricType<QuantityMetricType>" in content
|
|
407
|
+
assert "LabeledMetricType<CustomDistributionMetricType>" in content
|
|
408
|
+
assert ".customDistribution(" in content
|
|
409
|
+
assert "LabeledMetricType<TimingDistributionMetricType>" in content
|
|
410
|
+
assert ".timingDistribution(" in content
|
|
411
|
+
assert "LabeledMetricType<MemoryDistributionMetricType>" in content
|
|
412
|
+
assert ".memoryDistribution(" in content
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Any copyright is dedicated to the Public Domain.
|
|
2
|
-
# https://creativecommons.org/publicdomain/zero/1.0/
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
|
6
|
-
|
|
7
|
-
category:
|
|
8
|
-
labeled_counter:
|
|
9
|
-
type: labeled_counter
|
|
10
|
-
lifetime: user
|
|
11
|
-
description: >
|
|
12
|
-
Foo
|
|
13
|
-
bugs:
|
|
14
|
-
- https://bugzilla.mozilla.org/11137353
|
|
15
|
-
data_reviews:
|
|
16
|
-
- http://example.com/reviews
|
|
17
|
-
notification_emails:
|
|
18
|
-
- CHANGE-ME@example.com
|
|
19
|
-
send_in_pings:
|
|
20
|
-
- core
|
|
21
|
-
expires: 2100-01-01
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/glean_parser/templates/javascript.buildinfo.jinja2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_custom_ping_only_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_custom_ping_only_pings.yaml
RENAMED
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_events_and_custom_ping_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_events_and_custom_ping_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/go_server_labeled_boolean_metrics.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/python_server_metrics_unsupported.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_custom_ping_only_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_custom_ping_only_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/rust_server_events_and_custom_ping_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_and_custom_ping_compare.go
RENAMED
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_events_and_custom_ping_compare.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-20.2.0 → glean_parser-21.0.1}/tests/data/server_metrics_no_events_no_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|