Code Monkey home page Code Monkey logo

Comments (4)

ar2rsawseen avatar ar2rsawseen commented on July 20, 2024 1

Yes, that is the reason why heartBeat call rate is in ms not seconds, default beat interval being 500 ms or half of a second. With increased beat interval that could become a problem.

Why bulk requests are not used from the start? Well we have one guideline for all SDKs and currently we stick to it, adjusting the parameters per need. And Bulk API while being available for quite long time, was not always so reliable, as you can see notices in our docs, in some versions it was broken, in others did not guarantee correctly executed sequences, and was mostly used for bulk data importing and not SDK end point. It only became more stable in Countly Server version 16.06 and by that time all current SDKs were fully development and in the spirit of ("don't mend it if it is not broken") those are left as is for now.

But you are right, while mobiles apps probably not so much, but web SDK could benefit from it and most probably will move to bulk API in case of some more major sdk redesigning event.

from countly-sdk-web.

ar2rsawseen avatar ar2rsawseen commented on July 20, 2024

This is not how SDK would be intended to be used, but I think the right approach would be to take matter in your hands and construct a bulk request from what you have in the storage, cause you should be able to access storage outside SDK too and then empty it, before initializing SDK or calling any heartbeat.

You can read more about bulk request construction here: http://resources.count.ly/v1.0/reference#ibulk

and you can access internal methods to process query params if needed.

from countly-sdk-web.

khong07 avatar khong07 commented on July 20, 2024

Hi, thank you for your suggestion.
I have another question, why the heartBeat send only one element in the request queue per time and not all elements.

This behavior is not optimal in case of significant interval.
For example, in case of interval = 10s, in request queue, we have a alot of request : begin_session, session_durations, events, end_session, etc... We need ((nbOfElement-1) * 10s) time to send all requests to counlty server. If the user closes the browser soon and never comeback, we could miss a lot of informations.

This is may be not a real case because 10s is a lot. But the probleme can occurs in another case for example interval = 5s, we have a multi-pages web apps, everytime a page is loaded, multiple requests are added in the request queue (begin_session, events, end_sessions, begin_session, end_session, ...). If the user stays only 3s on each page, only one heartBeat is called. At the end, we have the same problem.

Do you has any suggestion? Or i'm missing something.
Thanks

from countly-sdk-web.

khong07 avatar khong07 commented on July 20, 2024

Thank you for your clarification, it's very helpful.

Keep up your great work!!

from countly-sdk-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.