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

chore: [#176778467] Track loading services details stats #2785

Merged
merged 12 commits into from
Feb 5, 2021

Conversation

Undermaken
Copy link
Contributor

Short description

This PR is useful to keep track of some measurements about loading services details
It is strictly related to this workaround about services loading

This tracking is based on a "in memory" stats tracking: the usage of the store (actions + reducer) adds a certain overhead and needs extra code to cover all cases

partial complete
partial complete

@Undermaken Undermaken changed the title [#176778467] Track services detail loading stats [#176778467] Track loading services details stats Feb 5, 2021
@pagopa-github-bot pagopa-github-bot changed the title [#176778467] Track loading services details stats chore: [#176778467] Track loading services details stats Feb 5, 2021
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Feb 5, 2021

Affected stories

  • ⚙️ #176778467: Come DA (Data Analyst) voglio conoscere quanto tempo impiega l'app per caricare il dettaglio di tutti i servizi visibili

Generated by 🚫 dangerJS against 16b1481

@codecov
Copy link

codecov bot commented Feb 5, 2021

Codecov Report

Merging #2785 (16b1481) into master (fad5740) will decrease coverage by 0.05%.
The diff coverage is 21.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2785      +/-   ##
==========================================
- Coverage   54.03%   53.98%   -0.06%     
==========================================
  Files         804      804              
  Lines       22203    22234      +31     
  Branches     4170     4180      +10     
==========================================
+ Hits        11997    12002       +5     
- Misses      10150    10176      +26     
  Partials       56       56              
Impacted Files Coverage Δ
...s/sagas/startup/loadServiceDetailRequestHandler.ts 36.36% <18.75%> (-26.14%) ⬇️
ts/sagas/services/refreshStoredServices.ts 100.00% <100.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 fad5740...16b1481. Read the comment docs.

@Undermaken Undermaken marked this pull request as ready for review February 5, 2021 10:39
Copy link
Contributor

@fabriziofff fabriziofff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Undermaken could you add SERVICES_DETAIL_LOADING_STATS to the mixpanel list with the possible payload parameters?

@Undermaken
Copy link
Contributor Author

Undermaken commented Feb 5, 2021

@fabriziofff
done!
Thanks for the reminder!

startTime: new Date().getTime() as Millisecond,
servicesId: new Set([...action.payload]),
loaded: 0,
toLoad: servicesDetailLoadTrack.servicesId.size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
toLoad: servicesDetailLoadTrack.servicesId.size
toLoad: action.payload.length

With the current implementation toLoad is always 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a bug, due to refactoring!
Good catch!
fixed
29baf38

Comment on lines 144 to 149
trackServicesDetailLoad({
...servicesDetailLoadTrack,
kind: "COMPLETE",
loadingTime: (new Date().getTime() -
servicesDetailLoadTrack.startTime) as Millisecond
});
Copy link
Contributor

@fabriziofff fabriziofff Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With some multiple tries on Android, I ran into this case (kind
PARTIAL):
Schermata 2021-02-05 alle 15 07 18

My proposal:
create a common function to calculate the loading time

const calculateLoadingTime = (startTime: Millisecond): Millisecond =>
  (startTime !== 0 ? new Date().getTime() - startTime : 0) as Millisecond;

and use it at line 147 and 163.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this scenario is when the app changes state but actually it is not loading any service
I add your suggestion and a condition to send "PARTIAL" only when there is a services loading running

16b1481

@fabriziofff fabriziofff merged commit f3f56de into master Feb 5, 2021
@fabriziofff fabriziofff deleted the 176778467-track-service-loading-elasped-time branch February 5, 2021 15:26
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.

3 participants