protected void Page_Load(object sender, EventArgs e) { loginService.HaveUrlRight(); //var list = new Monitor_DataLogsServer(true).GetLogNameAndServerIpCache(CacheTimeOption.TenMinutes).Select(p => p.DataLogName).Distinct().ToList(); //Dictionary<string, string> dic = new Dictionary<string, string>(); //list.ForEach(p => dic.Add(p, p)); Dictionary <string, string> dic = Monitor_DataLogsServer.GetDataLogNameDirt(); HeadControl1.LogNameSource = dic; HeadControl1.HiddenServerIp = true; reportTitle = "日志分布"; SeriesJsonStr = "[]"; allList = new List <Monitor_DataLogs>(); if (HeadControl1.IsFirstLoad) { HeadControl1.LogName = "sjqd"; } var temp = new Monitor_DataLogsServer(true).GetLogTransverseCache(HeadControl1.LogName, HeadControl1.BeginTime, HeadControl1.EndTime, CacheTimeOption.TenMinutes); if (temp.Count != 0) { SeriesJsonStr = GetYlineJson(temp); } else { reportTitle = "无数据"; } }
public void GetServerIp() { //if (!CheckHasRight("Reports/ServerLogReports/ServiceLogDateReport.aspx")) // return; //List<Monitor_DataLogs> logList = new Monitor_DataLogsServer(true).GetLogNameAndServerIpCache(CacheTimeOption.TenMinutes); //string logname = GetQueryString("logname"); //if (logList != null) //{ // var list = logList.Where(p => p.DataLogName == logname).Select(p=>p.ServerIp).ToList(); // StringBuilder sb = new StringBuilder("["); // for (int i = 0; i < list.Count; i++) // { // sb.Append("{").AppendFormat("\"ServerID\":\"{0}\",\"ServerIp\":\"{1}\"",list[i],list[i]).Append("},"); // } // ThisResponse.Write( sb.ToString().TrimEnd(',') + "]"); //} string[] serverIps = Monitor_DataLogsServer.GetServerIPList(); StringBuilder sb = new StringBuilder("["); for (int i = 0; i < serverIps.Length; i++) { sb.Append("{").AppendFormat("\"ServerID\":\"{0}\",\"ServerIp\":\"{1}\"", serverIps[i], serverIps[i]).Append("},"); } ThisResponse.Write(sb.ToString().TrimEnd(',') + "]"); }
private void BindData() { string[] serverip = HeadControl1.ServerIp.Split(','); for (int i = 0; i < serverip.Length; i++) { var temp = new Monitor_DataLogsServer(true).GetLogListByDateCache(HeadControl1.LogName, serverip[i], HeadControl1.BeginTime, HeadControl1.EndTime, Period, CacheTimeOption.TenMinutes); if (temp.Count != 0) { allList.Add(temp); X_DateTime.AddRange(temp.Select(p => p.LogDate).Distinct().ToList()); } } if (allList.Count == 0) { ReportTitle = "无数据"; return; } X_DateTime = X_DateTime.Distinct().OrderBy(p => p).ToList(); LineMaxNumCoef = X_DateTime.Count / LineMaxNum + 1; SetxAxisJson(X_DateTime); GetDataJsonList(allList); SeriesJsonStr = JsonConvert.SerializeObject(SeriesJsonModels); }
protected void Page_Load(object sender, EventArgs e) { loginService.HaveUrlRight(); //设置周期及默认周期 PeriodSelector1.AddPeriods( new net91com.Stat.Core.PeriodOptions[] { net91com.Stat.Core.PeriodOptions.Daily, net91com.Stat.Core.PeriodOptions.Hours, net91com.Stat.Core.PeriodOptions.TimeOfDay }, net91com.Stat.Core.PeriodOptions.Daily); Period = PeriodSelector1.SelectedPeriod; inputzhouqi.Value = Period.GetDescription(); //var list = new Monitor_DataLogsServer(true).GetLogNameAndServerIpCache(CacheTimeOption.TenMinutes).Select(p => p.DataLogName).Distinct().ToList(); //Dictionary<string, string> dic = new Dictionary<string, string>(); //list.ForEach(p => dic.Add(p, p)); Dictionary <string, string> dic = Monitor_DataLogsServer.GetDataLogNameDirt(); HeadControl1.LogNameSource = dic; HeadControl1.IsHasNoServerIp = true; ReportTitle = "日志曲线图"; AxisJsonStr = "{}"; SeriesJsonStr = "[]"; allList = new List <List <Monitor_DataLogs> >(); if (HeadControl1.IsFirstLoad) { HeadControl1.LogName = "sjqd"; if (HeadControl1.IsHasNoServerIp) { HeadControl1.ServerIp = "0"; } } BindData(); }