openstreetmap / tirex

Tirex tile queue manager. A drop-in replacement for renderd.
GNU General Public License v2.0
67 stars 23 forks source link

tirex-status does not display statistics for all configured zoom levels #28

Open stephankn opened 3 years ago

stephankn commented 3 years ago

I have a map configured with maxz=20. tirex-status does not display any statistics for zoom larger 17 until some tiles are rendered.

Expectation is that a 0 is displayed also for higher zoom levels up to maxz.

 Statistics:
  count_error=0
  count_expired=0
  count_rendered[osm]=0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 4, 478, 3
  count_requested=501
  count_timeouted=0
  sum_render_time[osm]=0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.111, 0, 0.815, 8.057, 8.050, 37.050, 2:24:20.754, 27.504
stephankn commented 3 years ago

Here a structure is initialized, but this part does not know about maps. Should it fetch configured maps and initialize full structure with 0? This might probably fix #29 as well.

https://github.com/openstreetmap/tirex/blob/5de9c9079a40d2ee5ccd36f89fdeed701a25c9ef/lib/Tirex/Manager.pm#L54

Does this location sound right? Is there any concern not exposing map configuration at this place?

woodpeck commented 3 years ago

I guess it can be changed and there's no architectural reason not to. However the list is rather unreadable as it is, and adding more zeroes to it will probably not improve that. Maybe a drastically different approach is needed if you actually want the statistics to be useful - e.g. opening a web port and outputting HTML there.

(For a halfway sane output of timings try tirex-status -t.)

stephankn commented 3 years ago

I would have to double-check again, but after reading the code I think the list is not initialized at all, so zeros will appear as soon as a higher level render job is done and statistic updated.

I agree with the point of readability. The statistics section in interactive mode might benefit from a rework to format both count_rendered and sum_render_time in a similar way than with the -t option. This would be another task.

For regular monitoring I feed the JSON output into Zabbix and fetch individual items with JSONPath on discovered maps with e.g. $.rm.stats.count_rendered.{#TIREXMAP}[11]. That is the part where missing entries will break the reporting.