Граф коммитов

137 Коммитов

Автор SHA1 Сообщение Дата
Beatriz Rizental 5ae75b1d17
Create metric to record upload failures (#967)
* Create metric to record upload failures

* Remove duplicate new_glean functions from core

* Get immutable reference in  function
2020-06-10 11:48:10 +02:00
Jan-Erik Rediger 7019b45dfe Bug 1634415 - Use `DistributionData` for memory distributions 2020-05-12 16:28:35 +02:00
Jan-Erik Rediger d7f3c93a56 Bug 1634415 - Use `DistributionData` for custom distributions 2020-05-12 16:28:32 +02:00
Jan-Erik Rediger 63ebf280e8 Bug 1634415 - Expose DistributionData for timing distributions 2020-05-12 16:28:24 +02:00
Jan-Erik Rediger adad798dc9 Apply clippy suggestions
[ci skip]
2020-04-27 16:32:45 +02:00
Michael Droettboom fa18d68d32
bug 1604177: Add reason code to the events ping (#797)
* bug 1604177: Add reason code to the events ping

* Fix swift

* Improve startup reason description
2020-04-03 08:42:29 -04:00
Jan-Erik Rediger 350486623c Ensure we only generate a deletion-request ping when toggling from on to off. 2020-02-21 15:49:05 +01:00
Michael Droettboom 3f1fca72ae
1608585: Fix labeled regex (#668)
* 1608585: Fix labeled regex

* Update docstring

* Update docs

* Add CHANGELOG

* spellcheck

* Move CHANGELOG entry
2020-02-14 22:20:16 +05:30
Jan-Erik Rediger 8b529ae348 Remove `ping_type` from pings. 2020-02-12 11:05:16 +01:00
Michael Droettboom 2e3f59be19
1557048: Add reason codes to the metrics ping (#649)
* 1557048: Add reason codes to the metrics ping

This adds support for sending reason codes along with pings.  The reason codes
are defined as an enumeration in the pings.yaml file, and only these values
are allowed on specific pings.

Additionally, this builds on that to add reason codes to the metrics ping.

* Use short form for enums

* Suppress compiler warning

* swiftlint

* NoReasonCodes -> NoExtraKeys

* Fix descriptions
2020-02-11 20:40:10 +05:30
Alessio Placitelli 0d54ed0b08 Report the InvalidState error in TimingDistribution
This will be reported when stop_and_accumulate() is
called without a prior call to start()
2020-01-20 10:21:47 +01:00
Jan-Erik Rediger c5a25e2347 Let clippy fix our code
With the release of Rust 1.40.0 a few new clippy lints were introduced.
For us they only apply to test code.
The following code automatically applied all of then:

  cargo +nightly fix -Z unstable-options --clippy

(This autofix feature requires Rust nightly, which is 2 versions ahead
of stable as always, but the code is still valid for our minimum supported Rust version)
2019-12-20 10:13:03 +01:00
Alessio Placitelli 6644ac7464 Fixup test due to testing API changes 2019-12-16 18:23:23 +01:00
Alessio Placitelli f7ffbdd651 Introduce the `InvalidOverflow` error
This is used by the timing distribution metric type
whenever a passed sample is bigger than 10 minutes.
2019-12-16 17:54:52 +01:00
Michael Droettboom efd231968a
1583514: Rename send -> submit (#570)
* 1583514: Rename send -> submit

* detekt

* Add additional missed changes

* Run cbindgen

* Add more missing changes

* Rename local variable

* Fix after rebase
2019-12-16 19:20:05 +05:30
Jan-Erik Rediger 433033957a Pass missing None argument in test function
This test was added after the new_glean function landed, but that change
was not included in the branch, so it only broke once merged into
master.
2019-12-16 12:11:57 +01:00
Jan-Erik Rediger 30683e4935
Don't send pings if upload is disabled (#575)
Don't send pings if upload is disabled
2019-12-16 11:20:56 +01:00
Jan-Erik Rediger e6d59e1c21 Don't send pings if upload is disabled 2019-12-13 14:31:11 +01:00
Jan-Erik Rediger 03562ec6c8
Update glean_parser (#574)
Update glean_parser
2019-12-13 12:25:44 +01:00
Beatriz Rizental cb9c400e29 Enhance `new_glean` test function to attend to all test cases (#572)
* Enhance `new_glean` test function to attend to all test cases

The `new_glean` function is a helper to create a new glean instance
for tests, to make code less repetitive. It didn't work for cases
when we needed to create multiple glean instances in the same test
with the same data directory. That was fixed by adding the option
to pass the tempdir as an argument to the function, thus making it
possible to call it multiple times with the same data directory.
2019-12-13 12:11:47 +01:00
Jan-Erik Rediger cc4bc7952c Rename `deletion_request` ping to `deletion-request` ping 2019-12-13 11:50:30 +01:00
Beatriz Rizental 02dfd1d0bd Add option to defer ping lifetime metric persistence 2019-12-04 13:43:09 +01:00
Jan-Erik Rediger b8ebdcb1cd Write the deletion ping into a separate directory 2019-11-28 13:01:39 +01:00
Jan-Erik Rediger 606594eb5e Add a new flag to pings: send_if_empty 2019-11-28 11:58:58 +01:00
Jan-Erik Rediger 1a23146bbb Check that the final `stop` recorded an error
At that point no timer is started (from the perspective of Glean), thus
an error should be reported on `stop`.
2019-11-28 11:22:38 +01:00
Jan-Erik Rediger dd46f91e60 Test that timespans are not recorded across upload toggles 2019-11-28 11:22:38 +01:00
Michael Droettboom 71b6a08b83
1595548: Fix truncation of string list items (#517)
* 1595548: Fix truncation of string list items

* Add CHANGELOG entry
2019-11-21 13:45:23 -05:00
Michael Droettboom a341c19010
1594712: Sort events by timestamp on their way out. (#458)
* 1594712: Sort events by timestamp on their way out.

* Add CHANGELOG entry
2019-11-11 11:43:07 -05:00
Jan-Erik Rediger e06653e1ac Record new error type "invalid state" to accurately describe the error
CAUTION: This might change error reporting for existing metrics.
2019-10-24 15:44:28 +02:00
Michael Droettboom e22638e1b2 1589743: Don't log pings twice 2019-10-24 09:24:20 -04:00
Michael Droettboom 345288b354
1588452: Don't crash TimingDistribution.start() prior to Glean.init (#400)
* 1588452: Don't crash TimingDistribution.start() prior to Glean.init

* iOS fixes

* Add docs

* Fix docs, update CHANGELOG
2019-10-24 09:20:47 -04:00
Michael Droettboom f9d0356422 1588451, 1530733: Handle dynamic labels in coroutine tasks
At present, the determination of (a) whether there are too many dynamic labels
on a metric, or (b) the label is invalid, are handled synchronously in the
get() operator (in Kotlin, the bracket operator).

This requires the Glean object to already be initialized at metric recording
time -- both to see how many labels have already been used, and also to record
any errors. This both means that labeled metrics can't be recorded prior to
initialization (even though most metrics now can), but more importantly,
blocking I/O is performed to determine how many labels have already been
recorded for the metric.

This PR changes how things work so the requested dynamic label is stored on
the specific labeled metric as a new field. This dynamic label is then converted
to its actual value later as part of the coroutine task, at which point we are
guaranteed to have an initialized Glean object.
2019-10-20 18:34:38 -04:00
Michael Droettboom ec75ee8ce9
1587405: Empty string list shouldn't be an error (#373) 2019-10-14 08:42:56 -04:00
Alessio Placitelli dd24450a26 Store pending pings in `pending_pings` instead of `pings` 2019-09-19 13:02:30 +02:00
Alessio Placitelli 3ae30ee2ef Bonus: use `get_queued_pings` in the ping.rs test 2019-09-19 13:01:34 +02:00
Jan-Erik Rediger 3318a17e4a Implement custom distribution (Rust) 2019-09-10 11:01:08 +02:00
Jan-Erik Rediger ada69f0b34
Remove stray debug printing from test 2019-09-09 14:03:06 +02:00
Jan-Erik Rediger 576c409f74 Implement a memory distribution metric (Rust) 2019-08-26 12:09:57 -07:00
Jan-Erik Rediger 65d644fb4c Switch timing distribution to use a functional histogram 2019-08-26 11:47:30 -07:00
Jan-Erik Rediger a382c268f8 Make (exponential) histogram implementation generic.
This will allow to extend it with a functional bucketing in the next
commit.
2019-08-26 11:36:20 -07:00
Michael Droettboom 39ae10e31b Address comments in PR 2019-08-22 15:19:01 -04:00
Travis Long 5009d7e703 Bug 1556995 - Fix Glean storing/sending of empty StringListMetricType 2019-08-13 11:46:37 -05:00
Jan-Erik Rediger bd5cd536b6 Test larger-than-u32 nanosecond value 2019-08-05 14:21:33 +02:00
Jan-Erik Rediger bde522f984 Use 64-bit integer for all values in a histogram.
The Kotlin side is passing in `Long`, which is equivalent to `i64`.
We can store time durations as nanoseconds.
The maximum value that a `u32` can represent in nanoseconds is barely
over 4 seconds.
It's easier if we just store it in a larger integer.
2019-08-05 14:19:28 +02:00
Alessio Placitelli 8f60e2ca07 Report an error if Timespans are used twice before are cleared
This allows catching multiple unintended start()/stop() call
cycles before a metric is cleared.
2019-08-01 10:37:31 +02:00
Jan-Erik Rediger aac2c71061 Fix all tests to include configuration object 2019-07-29 14:42:40 +02:00
Alessio Placitelli c42a88d9bd Don't report errors, when no errors occurred, in timing_distribution
This additionally adds a test that reports no error and one
that attempts to accumulate negative samples and, as such,
triggers error reporting.
2019-07-25 11:47:33 +02:00
Alessio Placitelli 71848cf743 Optimise accumulate_samples_signed and remove accumulate_samples
This additionally tweaks the related test to check that
negative samples are correctly discarded, in Rust.
2019-07-24 10:15:47 +02:00
Alessio Placitelli 25517ec5e3 Implement 'accumulate_samples' in Rust for timing_distribution 2019-07-24 10:13:26 +02:00
Michael Droettboom 14f491e873
1557366: Clear metrics when uploading is disabled (#169)
* 1557366: Clear metrics when uploading is disabled

* Address comments in PR

* Test that re(en/dis)abling is a noop

* Address comments in the PR

* Fix Kotlin warning

* Merge with events changes
2019-07-19 07:06:59 -04:00