/// <summary> /// 构造函数 /// </summary> public LogPerfController() { NG3LoggerManager.Info(typeof(LogPerfController), "LogController", "invoke time:" + Convert.ToString(DateTime.Now)); MultiDelegatingDbProvider.CurrentDbProviderName = LogDbProvider.LogDB; Stopwatch watch = Stopwatch.StartNew(); LogPerfService = base.GetObject <ILogPerfService>("SUP3.Log.Service.LogPerf"); NG3LoggerManager.Info(typeof(LogPerfController), "LogController", "elapsed time:" + watch.ElapsedMilliseconds); }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public string SaveOtherCfg() { //sql数据 string logOtherCfgGrid = System.Web.HttpContext.Current.Request.Form["logothercfggrid"]; var datas = JsonToModel.GetModifiedLogOtherCfgModel(logOtherCfgGrid); var savedresult = LogOtherCfgService.SaveOtherCfg(datas); //refresh 缓存 if (savedresult.SaveRows > 0) { NG3LoggerManager.RefreshLogOtherCfg(); } return(DataConverterHelper.SerializeObject(savedresult)); }
/// <summary> /// 将 /// </summary> public void PushPageLog() { try { string logData = System.Web.HttpContext.Current.Request.Form["data"]; if (string.IsNullOrEmpty(logData)) { return; } //将LogData进行JSON串解析 NameValueCollection times = new NameValueCollection(); JObject obj = JsonConvert.DeserializeObject(logData) as JObject; if (obj == null) { return; } //去除掉 string url = obj.Property("url").Value.ToString(); if (!string.IsNullOrEmpty(url) && url.IndexOf("?") > 0) { url = url.Substring(0, url.IndexOf("?")); } times.Add("url", url); times.Add("requesttime", obj.Property("requestTime").Value.ToString()); times.Add("commonjstime", obj.Property("commonJsTime").Value.ToString()); times.Add("loadpagetime", obj.Property("loadPageTime").Value.ToString()); times.Add("tcptime", obj.Property("tcpTime").Value.ToString()); times.Add("lookupdnstime", obj.Property("lookupDnsTime").Value.ToString()); times.Add("ttfb", obj.Property("ttfb").Value.ToString()); times.Add("redirecttime", obj.Property("redirectTime").Value.ToString()); //存入到数据库中 NG3LoggerManager.LogPage(times); } catch (Exception) { } }
/// <summary> /// /// </summary> public bool Get() { return(NG3LoggerManager.LogSorting()); }