Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add entityClassName to metrics adapter events #83

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

wschurman
Copy link
Member

Why

This adds the ability for concrete implementations of IEntityMetricsAdapter to segregate metric records by entity type. While not required (implementors can do whatever they like with the events), it may be helpful to find things like entity hot paths, slow tables, places that could use caches, etc.

This is not a breaking change as the interface is an object so code that worked with the old interface should work with the new interface.

How

Add parameter to definition and pipe through to log events.

Test Plan

yarn test (updated tests test the new behavior in addition to the old behavior to ensure no regressions).

@wschurman wschurman requested review from ide and jkhales October 8, 2020 20:51
@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #83 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   94.61%   94.61%           
=======================================
  Files          60       60           
  Lines        1522     1523    +1     
  Branches      181      181           
=======================================
+ Hits         1440     1441    +1     
- Misses         80       81    +1     
+ Partials        2        1    -1     
Flag Coverage Δ
#integration 94.61% <100.00%> (+<0.01%) ⬆️
#unittest 94.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/entity/src/EntityMutator.ts 98.00% <ø> (ø)
packages/entity/src/metrics/EntityMetricsUtils.ts 100.00% <ø> (ø)
...ckages/entity/src/metrics/IEntityMetricsAdapter.ts 100.00% <ø> (ø)
packages/entity/src/EntityCompanionProvider.ts 100.00% <100.00%> (ø)
packages/entity/src/internal/EntityDataManager.ts 100.00% <100.00%> (ø)
.../entity/src/internal/EntityTableDataCoordinator.ts 100.00% <100.00%> (ø)
packages/entity/src/EntityLoader.ts 87.32% <0.00%> (ø)
...es/entity/src/utils/testing/StubDatabaseAdapter.ts 90.32% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0cd8d8...93fbf43. Read the comment docs.

@wschurman wschurman merged commit f4cdc01 into master Oct 8, 2020
@wschurman wschurman deleted the @wschurman/per-entity-metrics branch October 8, 2020 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants