Open CodeBear801 opened 5 years ago
For verify whether traffic update is successful for each iteration,
Idea 1: test it by something like heartbeat(request)
We may not easy to test it by heartbeat since the traffic data will be customizing into OSRM files. We don't have switch to enable/disable traffic after osrm-routed
load data into memory. The only way to do it is send a lot of requests against both old and new container to see whether some of them are different. Obviously it's too inefficiency if we do it for each iteration.
Idea 2: refer to https://github.com/Telenav/osrm-backend/issues/22, there're some logs by osrm-customize
will show totally how many new traffics we have(6727490values
) and how many new traffics the osrm-customize
used(Used 0 speeds
):
[info] Loaded /Users/xunliu/Desktop/data/us_nv/traffic.csv with 6727490values
...
[info] Used 0 speeds from /Users/xunliu/Desktop/data/us_nv/traffic.csv
Proposal Solutions for Idea 2
threshold
to tell osrm-customize
to stop if the used / total <= threshold
. E.g. used / total <= 80%
, then the osrm-customize
will exit and return fail. The threshold
can be added to osrm-customize
as a command line flag, so that we can adjust easily to suitable for different data/traffic set. (MY PREFER)osrm-customize
, stop it once find the used / total
too small. The advantage is we don't need to modify codes of osrm-customize
.