public void OnObserve(EngineObserverData data) { var context = data.Context; if (context.Request.UrlReferrer != null) { var url = context.Request.UrlReferrer.AbsoluteUri; _db.RegisterHit(url); } var top=_db.GetTopPages(_Number); data.FinalData.Add("top_pages",top.ToArray() ); }
public void OnObserve(EngineObserverData data) { if (_handlers != null) { foreach (var c in data.Commands) { var h = _handlers.FirstOrDefault(i => i.Command == c.Name); if (h != null) { h.Handle(data); } } } }
private void HandleZeusCommands(EngineObserverData data) { IEnumerable<IZeusCommand> commands = data.Commands; if (commands != null) { foreach (var c in commands) { switch (c.Name) { case ApolloZeusCommands.PushUserArguments: PushUserArguments(data.User,c.Arguments); break; default: break; } } } }
public void OnObserve(EngineObserverData data) { HandleZeusCommands(data); //data.FinalData.Add("user", data.User); }