Git Product home page Git Product logo

Comments (10)

MustafaLeithy avatar MustafaLeithy commented on May 14, 2024

You mean the emails are being sent out but the reports are not counting the triggers correctly?

from bing-maps-fleet-tracker.

wvmstr avatar wvmstr commented on May 14, 2024

There is no data in the report. If you tell me what tables are involved then I can tell you if it is a matter of not adding correctly or a matter of not having data to count.

from bing-maps-fleet-tracker.

wvmstr avatar wvmstr commented on May 14, 2024

friendly reminder

from bing-maps-fleet-tracker.

MustafaLeithy avatar MustafaLeithy commented on May 14, 2024

I investigated this issue, and it was a regression caused by a change in the way GeofenceUpdates work, introduced in #6.

There is no easy fix for this, as reverting this change would cause significant performance issues in some cases. The proper solution is for the reports feature to be reworked to rely on aggregation tables instead of on the fly calculations.

If you are interested in contributing with this rework, I can share pointers with you on where to start.

from bing-maps-fleet-tracker.

wvmstr avatar wvmstr commented on May 14, 2024

I might be interested in taking a look. Can you PM me with details?

from bing-maps-fleet-tracker.

wvmstr avatar wvmstr commented on May 14, 2024

Friendly reminder.

from bing-maps-fleet-tracker.

MustafaLeithy avatar MustafaLeithy commented on May 14, 2024

Hi,

The current logic creating the reports can be found in Trackable.Services/Services/ReportingService.cs. This logic aggregates the data on the fly and returns that to the portal to display. This becomes ridiculously slow once you have a dozen or so assets and a few weeks worth of data, so we will need to change the way this works. This goes hand in hand with the fix for the geofences report, as the solution to both issues is the same: creating separate tables in the database that include aggregate counts.

A short article outlining what aggregate tables are can be found here. For the trips and points based reports, we should run a recurring job (see HostedInstrumentationService.cs and HostedServiceBase.cs as an example for how to schedule a job in ASP.Net Core 2) that aggregates the data from the real table, and stores the aggregated results in the aggregate tables which you will create. You can then modify the Trackable.Services/Services/ReportingService.cs to read from the aggregate tables you created, instead of re-aggregating for every request. This will also allow us to generate more powerful reports such as points per asset per day or the like.

For the geofence triggering reports, you will also create an aggregate table, however the aggregation logic cannot be done with a recurring job like the others. This is because we only store the latest GeoFenceUpdate in the database for performance reasons. The GeoFenceUpdates table is where we keep track of which Geofences have been triggered by each asset. Instead, you will need to modify the logic in the HandlePoints function in the Trackable.Services/Services/GeoFenceService.cs to write to the aggregate table (along with the original GeoFenceUpdates table) when updating the status for the triggered geofence/asset.

If you want to ask any further questions feel free to PM me or @momohs directly.

from bing-maps-fleet-tracker.

wvmstr avatar wvmstr commented on May 14, 2024

from bing-maps-fleet-tracker.

MustafaLeithy avatar MustafaLeithy commented on May 14, 2024

You can find my email on my profile.

from bing-maps-fleet-tracker.

momohs avatar momohs commented on May 14, 2024

I'll close this issue for now, please feel free to reopen/start a new one if more questions/issues pop up.

from bing-maps-fleet-tracker.

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.