piglei / uwsgi-sloth

Realtime uwsgi log file analyzer, slow requests analyzer.
Apache License 2.0
210 stars 17 forks source link

uwsgi-sloth latest_5mins.html fails when timezone uwsgi does not match timezone of user running uwsgi-sloth #11

Open harmv opened 5 years ago

harmv commented 5 years ago

My uwsgi logging is in utc, the users typically have timezone 'Europe/Amsterdam'.

running uwsgi-sloth start gives:

(v) harm@server:~/uwsgi-sloth$ uwsgi-sloth start -c myconf.conf 
[2019-02-28 11:38:14,005] uwsgi_sloth INFO: Start from last savepoint, last_log_datetime: 2019-02-28 11:33:14.005028
[2019-02-28 11:38:20,828] uwsgi_sloth INFO: Rendering HTML file /home/harm/uwsgi-sloth/html/html/latest_5mins.html...

As the uwsgi logging timestamps are in UTC (eg: "Thu Feb 28 10:40:00 2019") uwsgi-sloth does do the lookup for the last 5 minutes correctly.

Result

latest_5mins.html is always empty ( Slow / Total requests == 0 / 0 )

Expeced Result

latest_5mins.html shows the last 5 minutes.

html output should use the timezone of the user. The parsing of the uwsgi logging should be able to deal with the timezone difference between report and uwsgi logging.

harmv commented 5 years ago

Note workaround as mentioned in #9 does work, if I set export TZ=Europe/Amsterdam before running uwsgi-sloth start, then I do get output in latest_5mins.html.

But then the rendered html files show incorrect (utc) timstamps. I'd expect the html to render in the timezone as the users runs in.