Reland "[metrics_buffer] Move CodecMetrics to MetricsBuffer"

This is a reland of 837acacd67ba5de7fa68ddb0e97db78f35862b29

There was a missing ResetState() in the BatchingHappens test
such that the overall test would fail if attempt 0 failed,
instead of retrying several times as intended.

In addition, by tracking the max event count per aggregated
event this new version will succeed attempt 0 with very high
probability.

State reset is also improved to reset _all_ the state, to
avoid any possibility of async changes to counts causing any
unexpected values (not the reason for the flake before, but
still good to fix).

Overall, the metrics_buffer_test should not flake with this
new version.

Original change's description:
> [metrics_buffer] Move CodecMetrics to MetricsBuffer
>
> Generalize CodecMetrics and make it a lib called MetricsBuffer.
> This way MetricsBuffer can be used by both the HW video decoder
> and sysmem.
>
> Bug: fxbug.dev/86491
> Tested: MetricsBufferTest (many iterations)
> Change-Id: I1d855eb6e0b696a0749918625a6ffd01c00ba015
> Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/595121
> Commit-Queue: Dustin Green <dustingreen@google.com>
> Reviewed-by: Abdulla Kamar <abdulla@google.com>
> Reviewed-by: Austin Foxley <afoxley@google.com>

MULTIPLY: metrics_buffer_tests (fuchsia): 30
Bug: fxbug.dev/86491
Change-Id: Ie75ae9f60575a49b9bba8433c62ebd2f37351ac4
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/596161
Commit-Queue: Dustin Green <dustingreen@google.com>
Reviewed-by: Abdulla Kamar <abdulla@google.com>
Reviewed-by: Austin Foxley <afoxley@google.com>
(cherry picked from commit 37dcb1b6489730e2e6c0d4b92d86a0e74cbe5f80)
12 files changed
tree: c50900ae42f8e0a175666ca96fc51da071273db3
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. .style.yapf
  22. AUTHORS
  23. BUILD.gn
  24. CODE_OF_CONDUCT.md
  25. CONTRIBUTING.md
  26. LICENSE
  27. OWNERS
  28. PATENTS
  29. README.md
  30. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.