~detras/detras/0.4

« back to all changes in this revision

Viewing changes to dazer/analyzer/resources/AppCharts.py

  • Committer: Edmundo Álvarez Jiménez
  • Date: 2010-05-28 17:31:12 UTC
  • Revision ID: e.alvarezj@gmail.com-20100528173112-ipq01vy5d4wx4wcg
    * dazer/analyzer/resources/ClientCharts.py:
    * dazer/templates/clients.html:
        Added clients data analyzer.

    * dazer/analyzer/charts/ChartGenerator.py:
    * dazer/analyzer/resources/AppCharts.py:
    * dazer/analyzer/urls.py:
    * dazer/templates/applications.html:
        Several bugfixes and minor updates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
                data = {}
59
59
                
60
60
                cursor.execute( \
61
 
                        "select ew.application, e.duration from events e, eventwindow ew where e.event_type = %s and ew.id = e.event and e.duration is not null order by e.duration", \
62
 
                        [win_etype.id])
 
61
                        "select ew.application, e.duration from events e, eventwindow ew where e.event_type = %s and ew.id = e.event and e.duration is not null and e.timestamp >= %s and e.timestamp <= %s order by e.duration", \
 
62
                        [win_etype.id, idate, fdate])
63
63
                
64
64
                for i in cursor.fetchall():
65
65
                    app = i[0]
72
72
                
73
73
                sdata = sorted(data.iteritems(), key=itemgetter(1), \
74
74
                        reverse=True)[:numres]
75
 
#                print sdata
76
75
                
77
76
                chart = ChartGenerator.top_applications_by_time(sdata, numres)
78
77
                
98
97
                
99
98
                sdata = sorted(data.iteritems(), key=itemgetter(1), \
100
99
                        reverse=True)[:numres]
101
 
                print sdata
102
100
                
103
101
                chart = ChartGenerator.top_applications_by_users(sdata, numres)
104
102