Giter VIP home page Giter VIP logo

loopback-stats-mixin's People

Contributors

jonathan-casarrubias avatar victorhqc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

loopback-stats-mixin's Issues

Time bug in stats related to "Daylight saving time"

It seems to have a bug with the time in stats when the query time period includes a change in daylight saving time (for example, from PST to PDT or vice versa). See the output below for more details.

[{"date":"2016-11-01T23:00:00.000Z","universal":1478041200000,"count":0},{"date":"2016-11-02T23:00:00.000Z","universal":1478127600000,"count":0},{"date":"2016-11-03T23:00:00.000Z","universal":1478214000000,"count":0},{"date":"2016-11-04T23:00:00.000Z","universal":1478300400000,"count":0},{"date":"2016-11-05T23:00:00.000Z","universal":1478386800000,"count":0},{"date":"2016-11-07T00:00:00.000Z","universal":1478476800000,"count":0},{"date":"2016-11-08T00:00:00.000Z","universal":1478563200000,"count":0},{"date":"2016-11-09T00:00:00.000Z","universal":1478649600000,"count":0},{"date":"2016-11-10T00:00:00.000Z","universal":1478736000000,"count":0},{"date":"2016-11-11T00:00:00.000Z","universal":1478822400000,"count":0},{"date":"2016-11-12T00:00:00.000Z","universal":1478908800000,"count":1},{"date":"2016-11-13T00:00:00.000Z","universal":1478995200000,"count":0},{"date":"2016-11-14T00:00:00.000Z","universal":1479081600000,"count":0},{"date":"2016-11-15T00:00:00.000Z","universal":1479168000000,"count":1}]

The result above is from a query with the custom time range from "2016-11-01T00:00:00.000Z" to "2016-11-15T00:00:00.000Z". The time changes on Nov 6 from PDT to PST, and the time before Nov 7 are shifted by 1 hour.

I will send to PR with the solution.

Saving stats data

Hi, great mixin first of all, thanks.

If I understand correctly the data is generated on the fly when requested?
Would it be possible to create some sort of cache for it on a persisted model (DS) specified in mixin configuration by the user? Specifically it would be great to store this type of data into elastic search to unload the work from the database.

If not I guess a replication option would be plausible and just use stats on the read-only model :)

Thought?

Naming result object keys

I have a problem that the keys "count" and "date" don't match the keys accepted by the chart module, could you provide a way to specify custom names?

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.