예제 #1
0
import plotly.plotly as py
import plotly.graph_objs as go
from Parser import ParseUtil

# trace0 = Scatter(x=[1, 2, 3, 4],
#     y=[10, 15, 13, 17]
# )
# trace1 = Scatter(
#     x=[1, 2, 3, 4],
#     y=[16, 5, 11, 9]
# )
# data = [trace0, trace1]

# unique_url = py.plot(data, filename = 'basic-line')

pu = ParseUtil()
logs = pu.get_apache_logs()

#logObjects = pu.parse_logs(logs)


daysOfMonth = list(xrange(1, 31))
#months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
months = ['Oct', 'Nov']


#get hits from npcagent
hits_per_day = {'npcagent':[], 'ggjx':[]} 
for m in months:
	for day in daysOfMonth:
		dayLog = pu.get_logs_by_date(logs['npcagent_logs'], day, m)
예제 #2
0
import plotly.plotly as py
import plotly.graph_objs as go
from Parser import ParseUtil

# trace0 = Scatter(x=[1, 2, 3, 4],
#     y=[10, 15, 13, 17]
# )
# trace1 = Scatter(
#     x=[1, 2, 3, 4],
#     y=[16, 5, 11, 9]
# )
# data = [trace0, trace1]

# unique_url = py.plot(data, filename = 'basic-line')

pu = ParseUtil()
logs = pu.get_apache_logs()

#parsed_logs = pu.parse_logs(logs['ggjx_logs'])

#logObjects = pu.parse_logs(logs)

def graph_hits_per_day(logs):
	daysOfMonth = list(xrange(1, 31))
	#months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
	months = ['Oct', 'Nov']

	x_axis = []
	#get hits from npcagent
	hits_per_day = {'npcagent':[], 'ggjx':[], 'gjams':[]} 
	for m in months: