Code Monkey home page Code Monkey logo

Comments (7)

julen avatar julen commented on July 26, 2024

I now see this is used in the expanded stats view, but still the data is returned for all child items in the browsing table. We shouldn't do this, and maybe it's worth to even simplify the data we display in the expanded view.

from zing.

iafan avatar iafan commented on July 26, 2024

When it comes to stats, I think I changed the code not to export unnecessary fields. Did you recalculate the stats?

from zing.

julen avatar julen commented on July 26, 2024

Yes, definitely — please consider this issue in the context of #62 and the get_stats view, so definitely its exposure is way lower than regular browsing views.

Still, the main concerning point here is that there is too much information being cached. In browsing tables only the creation_time timestamp is used. The rest of the fields are pretty much unused until the detailed view is expanded, hence my doubt about the real usefulness of keeping that much data in the cache.
If we still want to keep that information visible, we can likewise make things more compact by keeping only the mtime, the trimmed source and the unit id.

Since with the recent changes we are already required to run a server-wide refresh_stats, I'm thinking that it makes sense to make any stats cache-related changes now and reduce to the minimum the amount of times we need to manually refresh stats.

from zing.

iafan avatar iafan commented on July 26, 2024

In the detailed stats view, we can definitely use only timestamps as well. So feel free to remove all datetime fields. Where specifically are they currently used?

from zing.

julen avatar julen commented on July 26, 2024

The rendering of last actions is already using timestamps in the detailed view, so the rest of datetimes are redundant.

Regarding the other fields, source (trimmed) and unit_url are used only, specifically in the expanded stats view. I was suggesting that in case we want to keep these, we could compact them even more to store source and uid only (then we can permalink to //server.tld/unit/<uid>/.

So the cached information would be reduced to:

{
  "lastupdated": {
    "mtime": <int:timestamp>,
    "source": <string:unit-source>,
    "uid": <int:unit-id>,
  }
}

or in case we decide not to display last updated information besides the date:

{
  "lastupdated": <int:timestamp>
}

from zing.

iafan avatar iafan commented on July 26, 2024

As I understand, we're referring to the 'Last updated' column used in the browser table, and to the 'Updates' section in the expanded stats. The first one indeed requires only the timestamp and is heavily used, while the other seems to be less useful.

So if our only reason to cache extra data is to display this 'Updates' section, we can ditch it and store only the timestamp.

from zing.

julen avatar julen commented on July 26, 2024

Your understanding is correct, and totally agree with what you say (it's in line with what I was proposing above). I'll update #75 so that we cache timestamps only.

from zing.

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.