Closed Bug 1527670 Opened 6 years ago Closed 6 years ago

[glean] TECHDEBT: Move value validation and correction from MetricType to StorageEngine

Categories

(Toolkit :: Telemetry, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: mdroettboom, Assigned: travis_)

References

Details

(Whiteboard: [telemetry:mobilesdk:m7])

Attachments

(1 file)

There is a lot of value validation that happens in the *MetricType classes, such as truncating strings when they are too long. In some cases for technical reasons, the validation is split between the *MetricType and *StorageEngine classes (individual strings in a string list vs. the string list as a whole).

All of this should be moved to the *StorageEngine classes. There are at least two good reasons for this:

  1. When we oxidize glean, we will be oxidizing the internal classes (*StorageEngine) not the public API interface classes (*MetricType). Having important logic in the *MetricType classes means we will need to duplicate that logic across all flavors of glean (Android, iOS etc.)

  2. Notating errors currently has to happen in a separate coroutine worker from the recording of the metric value itself. This causes race conditions that makes testing harder and requires the addition of a "hack" to record errors synchronously during testing.

Blocks: 1513945
Priority: -- → P3
Blocks: 1491345
Whiteboard: [telemetry:mobilesdk:m?] → [telemetry:mobilesdk:m7]
Assignee: nobody → tlong
Priority: P3 → P1
Attached file GitHub Pull Request (deleted) —

This was merged \o/ closing it!

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: