Exemplo n.º 1
0
def get_data(ds):
	player = LogPlayer( ds )
	analyzer = XYAnalyzer( mapper=lambda e: (datetime.fromtimestamp(mktime(e.timestamp)).isocalendar()[1] +  datetime.fromtimestamp(mktime(e.timestamp)).isocalendar()[2]/7.0, 1) )
	player.add_analyzer(analyzer)
	player.forward()
	X,Y = analyzer.get_xy()
	return aggregate(X,Y)
Exemplo n.º 2
0
def get_data(ds):
	player = LogPlayer(ds)
	analyzer = XYAnalyzer(mapper=lambda e: (e.timestamp.tm_hour + (e.timestamp.tm_min/30*30)/60.0, e.proc_ms ))
	player.add_analyzer(analyzer)
	player.forward()
	X,Y = analyzer.get_xy()
	return aggregate(X,Y)
Exemplo n.º 3
0
def get_data(ds):
	player = LogPlayer( ds )
	analyzer = XYAnalyzer( mapper=lambda e: (e.timestamp.tm_wday + (e.timestamp.tm_hour / 24.0), 1) )
	player.add_analyzer(analyzer)
	player.forward()
	X,Y = analyzer.get_xy()
	return aggregate(X,Y)
Exemplo n.º 4
0
def get_data(path, mpr, aggregator):
    ds = CsvFileSource(path, event_type="WMS")
    player = LogPlayer(ds)
    analyzer = XYAnalyzer(mapper=mpr)
    player.add_analyzer(analyzer)
    player.forward()
    X, Y = analyzer.get_xy()
    return aggregator(X, Y)
Exemplo n.º 5
0
def get_data(path, mapper, reducer):
	ds = CsvFileSource(path, event_type='WMS')
	player = LogPlayer(ds)
	analyzer = XYAnalyzer(mapper=mapper)
	player.add_analyzer(analyzer)
	player.forward()
	X,Y = analyzer.get_xy()
	#print X,Y
	return reducer(X,Y)
Exemplo n.º 6
0
def make_plot(ds, title, color):
	player = LogPlayer(ds)
	analyzer = XYAnalyzer(mapper=lambda e: (e.timestamp.tm_hour + (e.timestamp.tm_min/15*15)/60.0, e.answer_size / 1024.0), filter=lambda e: e.answer_size > 0)
	player.add_analyzer(analyzer)
	player.forward()
	X,Y = analyzer.get_xy()
	X, Ymin, Yavg, Ymax = aggregate(X,Y)

	#plt.axis([0, len(X), 0, max(Yavg)])
	plt.title(title)
	plt.xlabel('Hour of day')
	plt.ylabel('Average answer size in kilobytes (KB)')
	plt.plot(X, Yavg, color)
	plt.show()
Exemplo n.º 7
0
def get_data(path, mpr, aggregator):
    ds = CsvFileSource(path, event_type='WMS')
    player = LogPlayer(ds)
    analyzer = XYAnalyzer(mapper=mpr)
    player.add_analyzer(analyzer)
    player.forward()
    X, Y = analyzer.get_xy()
    return aggregator(X, Y)
Exemplo n.º 8
0
def get_data(ds):
	player = LogPlayer(ds)
	#analyzer = XYAnalyzer(mapper=lambda e: (e.timestamp.tm_hour + (e.timestamp.tm_min/15*15)/60.0, e.proc_ms ))
	analyzer = XYAnalyzer(mapper=lambda e: (e.timestamp.tm_hour + (e.timestamp.tm_min/15*15)/60.0, 256.0**2 * e.proc_ms / float(e.query.width*e.query.height) ))
	player.add_analyzer(analyzer)
	player.forward()
	X,Y = analyzer.get_xy()
	return aggregate(X,Y)
Exemplo n.º 9
0
def get_data(ds):
    player = LogPlayer(ds)
    analyzer = XYAnalyzer(mapper=lambda e: (e.timestamp.tm_hour + (
        e.timestamp.tm_min / 30 * 30) / 60.0, 1 / 30.0))
    player.add_analyzer(analyzer)
    player.forward()
    X, Y = analyzer.get_xy()
    return aggregate(X, Y)
Exemplo n.º 10
0
def get_data(ds):
    player = LogPlayer(ds)
    analyzer = XYAnalyzer(mapper=lambda e: (e.timestamp.tm_wday +
                                            (e.timestamp.tm_hour / 24.0), 1))
    player.add_analyzer(analyzer)
    player.forward()
    X, Y = analyzer.get_xy()
    return aggregate(X, Y)
Exemplo n.º 11
0
def get_data(path, mapper, reducer):
    ds = CsvFileSource(path, event_type='WMS')
    player = LogPlayer(ds)
    analyzer = XYAnalyzer(mapper=mapper)
    player.add_analyzer(analyzer)
    player.forward()
    X, Y = analyzer.get_xy()
    #print X,Y
    return reducer(X, Y)
Exemplo n.º 12
0
def get_data(ds):
    player = LogPlayer(ds)
    analyzer = XYAnalyzer(mapper=lambda e: (datetime.fromtimestamp(
        mktime(e.timestamp)).isocalendar()[1] + datetime.fromtimestamp(
            mktime(e.timestamp)).isocalendar()[2] / 7.0, 1))
    player.add_analyzer(analyzer)
    player.forward()
    X, Y = analyzer.get_xy()
    return aggregate(X, Y)