trac-hacks / tracstats

Project and source code statistics plugin for Trac.
http://trac-hacks.org/wiki/TracStatsPlugin
Other
20 stars 13 forks source link

Plugin crashes on viewing the ticket pane #16

Closed icco closed 13 years ago

icco commented 13 years ago
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_request
  dispatcher.dispatch(req)
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 235, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/tracstats/web_ui.py", line 156, in process_request
  result = self._process_tickets(req, cursor, where, data)
File "build/bdist.linux-x86_64/egg/tracstats/web_ui.py", line 981, in _process_tickets
  stats.append({'name': summary, 
File "build/bdist.linux-x86_64/egg/trac/util/datefmt.py", line 63, in to_datetime
  raise TypeError('expecting datetime, int, long, float, or None; got %s' %

We're using trac stats 0.3 (github head from august 3rd...), trac 0.12, with mysql backend, and have just shy of 5000 tickets.

Trac 0.12 Genshi 0.6 MySQL server: "5.0.77", client: "5.0.44", thread-safe: 1 MySQLdb 1.2.1 Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] setuptools 0.6c5 Subversion 1.4.2 (r22196) jQuery 1.4.2

mrjbq7 commented 13 years ago

I tested on trac 0.12 with mysql and I got a slightly different error -- conversion error from decimal.Decimal. I just pushed a fix for it if you'd like to try again and see if that corrects your problem?

What version of Python are you using?

mrjbq7 commented 13 years ago

Nevermind re: python version. I just noticed your list.

icco commented 13 years ago

Hmm. No luck. Still got TypeError: expecting datetime, int, long, float, or None; got <class 'decimal.Decimal'>

mrjbq7 commented 13 years ago

Can you make sure you installed the patch?

$ grep to_datetime tracstats/web_ui.py from trac.util.datefmt import pretty_timedelta, to_datetime 'time': pretty_timedelta(to_datetime(float(t))),}) 'time': pretty_timedelta(to_datetime(float(t))),}) 'time': pretty_timedelta(to_datetime(float(t))),}) 'time': pretty_timedelta(to_datetime(float(t))),}) 'time': pretty_timedelta(to_datetime(float(t))),})

mrjbq7 commented 13 years ago

Fixed formatting:

$ grep to_datetime tracstats/web_ui.py 
from trac.util.datefmt import pretty_timedelta, to_datetime
                      'time': pretty_timedelta(to_datetime(float(t))),})
                      'time': pretty_timedelta(to_datetime(float(t))),})
                      'time': pretty_timedelta(to_datetime(float(t))),})
                      'time': pretty_timedelta(to_datetime(float(t))),})
                      'time': pretty_timedelta(to_datetime(float(t))),})
icco commented 13 years ago

Nevermind! Totally forgot to restart httpd. Once I did the page actually loaded. Thanks!

The accepted tickets graph is still broken, but I assume you'd like a seperate issue for that? http://cl.ly/2Zxq and http://cl.ly/2aXh

mrjbq7 commented 13 years ago

Assigning tickets to people is considered different from accepting assigned tickets -- its something I'd like to make better.

Perhaps you could open a ticket with these pictures and some suggestions on what would be useful stats to see in those graphs?

mrjbq7 commented 13 years ago

Closing this ticket for now.

ronalde commented 12 years ago

At our site, the ticketpane nevers comes up with any results.

We have about 9000 tickets. Using version 0.4 of the plugin on debian squeeze with upstream trac 0.12.2.

Any clues?

ronalde commented 12 years ago

when I add a filter like /stats/tickets?author=someone (someone having about 1500 tickets) the ticketplane is displayed (fast enough).

mrjbq7 commented 12 years ago

I believe I've fixed this in 0f027988eab6c906c194adc17e1cd2d206311d0e (improving the speed of two of the ticket SQL queries).

Could you re-install and try again?

ronalde commented 12 years ago

Super, thanks for your ninja-like response!