mean-expert-official / loopback-stats-mixin Goto Github PK
View Code? Open in Web Editor NEWA mixin to provide statistical functionallity for Loopback Models, Relations and Nested Datasets
License: MIT License
A mixin to provide statistical functionallity for Loopback Models, Relations and Nested Datasets
License: MIT License
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.
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?
Could you provide more example of each type of boot option, please?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.