private void BindData() { DataTable dt_rptData = new DataTable(); // 챠트그릴 리스트를 가져온다 cloud.R_Adhoc("SELECT TOP 1 Data_JSON FROM tbPerfmonValues_JSON where ServerNum = " + ServerNum + " and TimeIn_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' order by TimeIn_UTC desc"); //챠트그릴 리스트가 잇다면 if (cloud.dsReturn.Tables.Count > 0 && cloud.dsReturn.Tables[0].Rows.Count > 0) { //1단계 리피트에 챠트디자인 dt_rptData = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); dt_rptData.DefaultView.Sort = "PCounterName asc"; dt_rptData.Columns.Add("Seq"); } int indx = 0; foreach (DataRow dr in dt_rptData.Rows) { dr["seq"] = indx; indx = indx + 1; } rpt_Chart.DataSource = dt_rptData.DefaultView.ToTable(); rpt_Chart.DataBind(); //2단계 디자인된챠트의 헤더값을 바인딩하여 챠트그리기 if (dt_rptData.Rows.Count > 0) { DataTable dt_PerfmonValue = new DataTable(); List <DataTable> dt_list = new List <DataTable>(); cloud.R_Adhoc("SELECT servernum, Data_JSON FROM tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum + " order by TimeIn_UTC desc"); //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = Lib.Flotr2.SetArrayString_Lines_Report(dt_PerfmonValue, SetChartProperty(dt_rptData)); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); sb.Replace("func_Line", "func_Line_Report"); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); } }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.R_HostInfo(Lib.Util.TConverter <int>(ddl_Server.SelectedValue)); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); } //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } { //dt_CPU 데이터 테이블 만들기 var PCIDs = new[] { "P139", "P004", "P107", "P108", "P106", "P184" }; var test = from r in dt_PerfmonValue.AsEnumerable() where PCIDs.Contains(r.Field <string>("PCID")) || (r.Field <string>("PCID") == "P001" && r.Field <string>("InstanceName") == "_Total") select r; dt_CPU = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_CPU.NewRow(); newRow.ItemArray = r.ItemArray; dt_CPU.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_SQL = Lib.ConvertingProc.Pivot(dt_SQL, "Instancename", "TimeIn", "PValue"); dt_CPU = Func_SetColumn(dt_CPU); } //실행 쿼리 데이터 읽어오기 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbSQLCurrentExecution_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_SQLQuery = tester.Clone(); dt_SQLQuery.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_SQLQuery.Merge(dt_tmp); } } { //dt_SQLCurrentQuery 데이터 테이블 만들기 var test = (from r in dt_SQLQuery.AsEnumerable() orderby r.Field <Int64>("cpu_time") descending select r).Take(20); dt_SQLCurrentQuery = dt_SQLQuery.Clone(); foreach (DataRow r in test) { var newRow = dt_SQLCurrentQuery.NewRow(); newRow.ItemArray = r.ItemArray; dt_SQLCurrentQuery.Rows.Add(newRow);//I'm doubtful if you need to call this or not } gv_List_Query.DataSource = dt_SQLCurrentQuery; gv_List_Query.DataBind(); } //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Line_DualYAxis(dt_CPU, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_CPU, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.R_HostInfo(Lib.Util.TConverter <int>(ddl_Server.SelectedValue)); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); } //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } { //dt_SQLDATA 데이터 테이블 만들기 var PCIDs = new[] { "P007", "P081", "P138", "P084", "P098" , "P008", "P168", "P176", "P177", "P102" , "P178", "P179", "P103", "P104", "P105" , "P180", "P181", "P182", "P183", "P100" , "P101" }; var test = from r in dt_PerfmonValue.AsEnumerable() where PCIDs.Contains(r.Field <string>("PCID")) select r; dt_SQLData = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_SQLData.NewRow(); newRow.ItemArray = r.ItemArray; dt_SQLData.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_SQLData = Func_SetColumn(dt_SQLData); } //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Line_DualYAxis(dt_SQLData, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_SQLData, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.R_HostInfo(Lib.Util.TConverter <int>(ddl_Server.SelectedValue)); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); } int numDuration = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ChartDataDuration"]); //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } { //dt_Avgwaintime 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P129" select r; dt_Avgwaintime = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_Avgwaintime.NewRow(); newRow.ItemArray = r.ItemArray; dt_Avgwaintime.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_Avgwaintime = Lib.ConvertingProc.Pivot(dt_Avgwaintime, "Instancename", "TimeIn", "Pvalue"); strColumn_AVGWAITTIME = Lib.ConvertingProc.GetColumname(dt_Avgwaintime.Columns); } { //dt_LockRequest 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P130" select r; dt_LockRequest = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LockRequest.NewRow(); newRow.ItemArray = r.ItemArray; dt_LockRequest.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LockRequest = Lib.ConvertingProc.Pivot(dt_LockRequest, "Instancename", "TimeIn", "Pvalue"); strColumn_LockRequest = Lib.ConvertingProc.GetColumname(dt_LockRequest.Columns); } { //dt_LockTimeoutTimeout 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P199" select r; dt_LockTimeoutTimeout = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LockTimeoutTimeout.NewRow(); newRow.ItemArray = r.ItemArray; dt_LockTimeoutTimeout.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LockTimeoutTimeout = Lib.ConvertingProc.Pivot(dt_LockTimeoutTimeout, "Instancename", "TimeIn", "Pvalue"); strColumn_LockTimeOutTimeOut = Lib.ConvertingProc.GetColumname(dt_LockTimeoutTimeout.Columns); } { //dt_LockTimeout 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P131" select r; dt_LockTimeout = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LockTimeout.NewRow(); newRow.ItemArray = r.ItemArray; dt_LockTimeout.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LockTimeout = Lib.ConvertingProc.Pivot(dt_LockTimeout, "Instancename", "TimeIn", "Pvalue"); strColumn_LockTimeOut = Lib.ConvertingProc.GetColumname(dt_LockTimeout.Columns); } { //dt_LockWaitTimeMs 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P132" select r; dt_LockWaitTimeMs = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LockWaitTimeMs.NewRow(); newRow.ItemArray = r.ItemArray; dt_LockWaitTimeMs.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LockWaitTimeMs = Lib.ConvertingProc.Pivot(dt_LockWaitTimeMs, "Instancename", "TimeIn", "Pvalue"); strColumn_LockWaitTimeMs = Lib.ConvertingProc.GetColumname(dt_LockWaitTimeMs.Columns); } { //dt_LockWaitTimeSec 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P133" select r; dt_LockWaitTimeSec = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LockWaitTimeSec.NewRow(); newRow.ItemArray = r.ItemArray; dt_LockWaitTimeSec.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LockWaitTimeSec = Lib.ConvertingProc.Pivot(dt_LockWaitTimeSec, "Instancename", "TimeIn", "Pvalue"); strColumn_LockWaitSec = Lib.ConvertingProc.GetColumname(dt_LockWaitTimeSec.Columns); } { //dt_NumberofDeadlock 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P134" select r; dt_NumberofDeadlock = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_NumberofDeadlock.NewRow(); newRow.ItemArray = r.ItemArray; dt_NumberofDeadlock.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_NumberofDeadlock = Lib.ConvertingProc.Pivot(dt_NumberofDeadlock, "Instancename", "TimeIn", "Pvalue"); strColumn_NumberofDeadlock = Lib.ConvertingProc.GetColumname(dt_NumberofDeadlock.Columns); } //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_Avgwaintime, cplst, "AVGWAITTIME_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LockRequest, cplst, "LOCKREQUESTS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LockTimeoutTimeout, cplst, "LOCKTIMEOUTSTIMEOUT_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LockTimeout, cplst, "LOCKTIMEOUTS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LockWaitTimeMs, cplst, "LOCKWAITTIMEMS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LockWaitTimeSec, cplst, "LOCKWAITSEC_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_NumberofDeadlock, cplst, "NUMBEROFDEADLOCKS_LINE_CHART"); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { //호스트 정보 가져오기 cloud.R_Adhoc("select ServerNum,HostName,DisplayName,DisplayGroup,RAMSIZE,IPAddress,ServerType,WinVer,Processors,CurrentStatus, TimeIn_UTC from tbHostStatus where ServerNum = " + ServerNum); dt_Server = cloud.dsReturn.Tables[0]; dt_Server = Lib.ConvertingProc.SetDashboardDtServer(dt_Server); //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select a.TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON as a with(nolock) inner join tbHostStatus as b on a.TimeIn_UTC = b.TimeIn_UTC and a.ServerNum = b.ServerNum where b.ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } //tbDashboard 공통 데이터 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbDashboard_JSON with(nolock) where ServerNum = " + ServerNum + " and TimeIn_UTC >= dateadd(minute, -15, GETUTCDATE())"); if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_Dashboard = tester.Clone(); dt_Dashboard.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_Dashboard.Merge(dt_tmp); } } //DB 정보 가져오기 //int nReturn = cloud.w_Dashboard_SQL_Server(MemberNum, CompanyNum, ServerNum); cloud.R_Adhoc("select InstanceName,IsClustered,ComputerNamePhysicalNetBIOS,Edition,ProductLevel,ProductVersion,ProcessID,Collation,IsFullTextInstalled,IsIntegratedSecurityOnly,IsHadrEnabled,HadrManagerStatus,IsXTPSupported from tbSQLServerInfo where ServerNum = " + ServerNum); dt_DBInfo = cloud.dsReturn.Tables[0]; //dt_FreeDisk 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where (r.Field <string>("PCID") == "P018" || r.Field <string>("PCID") == "P164" || r.Field <string>("PCID") == "P015" || r.Field <string>("PCID") == "P190" || r.Field <string>("PCID") == "P194") && !r.Field <string>("InstanceName").Contains("_Total") && !r.Field <string>("InstanceName").Contains("HarddiskVolume") select r; dt_FreeDisk = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_FreeDisk.NewRow(); newRow.ItemArray = r.ItemArray; dt_FreeDisk.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //MaxDIsk 정보 가져오기 dt_MaxDisk = Lib.ConvertingProc.SetDiskMaxProc(dt_FreeDisk); dt_MaxDisk = Lib.ConvertingProc.SetDashboardDtServer(dt_MaxDisk); //dt_FreeDisk = Lib.ConvertingProc.Pivot(dt_FreeDisk, "InstanceName", "TimeIn", "PValue"); dt_FreeDisk = Lib.ConvertingProc.SetDiskProc(dt_FreeDisk); //dt_Processor 데이터 테이블 만들기 var Processor = from r in dt_Dashboard.AsEnumerable() where (r.Field <string>("PNum") == "P0") select r; dt_Processor = dt_Dashboard.Clone(); foreach (DataRow r in Processor) { var newRow = dt_Processor.NewRow(); newRow.ItemArray = r.ItemArray; dt_Processor.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //SQL Dashboard 성능 정보 가져오기 int nReturn = cloud.get_Dashboard_Chart(ServerNum.ToString()); dt_Data = Lib.ConvertingProc.ChangeDashboardColumnName(cloud.dsReturn.Tables[0]); dt_Data = Lib.ConvertingProc.SetDashboardDtServer(dt_Data); //성능 정보에서 최근값을 라벨에 뿌려주기 위해 MaxData 생성해서 마지막 값 읽기 dt_MaxData = new DataTable(); dt_MaxData = dt_Data.Clone(); dt_MaxData.ImportRow(dt_Data.Rows[dt_Data.Rows.Count - 1]); //dt_MaxData = Lib.ConvertingProc.SetDashboardDtServer(dt_MaxData); //SQL Agent Fail //nReturn = cloud.get_SQLAgentFail(ServerNum); //numSQLAgent = cloud.dsReturn.Tables[0].Rows.Count; //SQL Lnked //nReturn = cloud.get_SQLLinked(ServerNum); //numSQLLinked = cloud.dsReturn.Tables[0].Rows.Count; //SQL Service //nReturn = cloud.get_SQLServiceStatus(ServerNum); //numSQLService = cloud.dsReturn.Tables[0].Rows.Count; //SQL Error //nReturn = cloud.get_SQLErrorlog(ServerNum); //numSQLLinked = cloud.dsReturn.Tables[0].Rows.Count; //SQL Session //nReturn = cloud.get_SQLSession(ServerNum); //if (cloud.dsReturn.Tables[0].Rows.Count > 0) //{ // //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 // DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); // //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 // //DataTable dt_struct = new DataTable(); // dt_SQLSession = tester.Clone(); // dt_SQLSession.AcceptChanges(); // // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 // foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) // { // DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); // //신규추가 2017-09-23 데이터 머지 = mssql union // //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx // dt_SQLSession.Merge(dt_tmp); // } //} //foreach (DataRow dr in dt_SQLSession.Rows) //{ // numSessionCNT += Convert.ToInt32(dr["TotalSession"].ToString()); // numActiveSession += Convert.ToInt32(dr["ActiveSession"].ToString()); //} //SQL Database File Size //nReturn = cloud.get_SQLDatabaseFileSize(ServerNum); //if (cloud.dsReturn.Tables[0].Rows.Count > 0) //{ // //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 // DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); // //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 // //DataTable dt_struct = new DataTable(); // dt_DatabaseFileSize = tester.Clone(); // dt_DatabaseFileSize.AcceptChanges(); // // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 // foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) // { // DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); // //신규추가 2017-09-23 데이터 머지 = mssql union // //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx // dt_DatabaseFileSize.Merge(dt_tmp); // } //} //numDatabaseCNT = dt_DatabaseFileSize.Rows.Count; //numDataFileSize_Total = 0; //numDataFileSize_Use = 0; //numLogFileSize_Total = 0; //numLogFileSize_Use = 0; //if (dt_DatabaseFileSize.Rows.Count > 0) //{ // foreach (DataRow dr in dt_DatabaseFileSize.Rows) // { // numDataFileSize_Total = numDataFileSize_Total + Convert.ToDouble(dr["Datafile_Size_MB"].ToString()); // numDataFileSize_Use = numDataFileSize_Use + Convert.ToDouble(dr["Data_MB"].ToString()) + Convert.ToDouble(dr["Index_MB"].ToString()); // numLogFileSize_Total = numLogFileSize_Total + Convert.ToDouble(dr["Transaction_Log_Size"].ToString()); // numLogFileSize_Use = numLogFileSize_Use + Convert.ToDouble(dr["Log_Used_Size_MB"].ToString()); // numVLFCNT = 0; // stVLF_DB = ""; // if (Convert.ToInt32(dr["Total_vlf_cnt"].ToString()) > numVLFCNT) // { // numVLFCNT = Convert.ToInt32(dr["Total_vlf_cnt"].ToString()); // stVLF_DB = dr["DatabaseName"].ToString(); // } // } //} //SQL Index Flag numIndexFlag = 0; numIndexFlagObject = ""; //nReturn = cloud.get_SQLIndexflag(ServerNum); //if (cloud.dsReturn.Tables[0].Rows.Count > 0) //{ // //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 // DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); // //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 // dt_SQLIndexFlag = tester.Clone(); // dt_SQLIndexFlag.AcceptChanges(); // foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) // { // DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); // dt_SQLIndexFlag.Merge(dt_tmp); // } // foreach (DataRow dr in dt_SQLIndexFlag.Rows) // { // if (Convert.ToInt32(dr["avg_frag_percent"].ToString()) > numIndexFlag) // { // numIndexFlag = Convert.ToInt32(dr["avg_frag_percent"].ToString()); // numIndexFlagObject = dr["db_name"].ToString() + ":" + dr["object_name"].ToString(); // } // } //} //차트 데이터 던지기 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_Data, SetChartProperty()); cplst = Lib.Flotr2.SetArrayString_Cols(dt_Data, cplst); cplst = Lib.Flotr2.SetArrayString_Bar(dt_FreeDisk, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript_UC.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { pnl_chart.Visible = true; cloud.get_ServerStatus(ServerNum.ToString()); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); string strPCID = System.Text.RegularExpressions.Regex.Split(strParameter, "#c#")[0]; string strInstanceName = System.Text.RegularExpressions.Regex.Split(strParameter, "#c#")[1]; //if (strInstanceName.ToLower() == "allinstance") // strInstanceName = ""; //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where TimeIn_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and TimeIn_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } //특정 카운터 데이터 테이블 만들기 if (strInstanceName.ToLower() == "allinstance") { var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == strPCID.ToString() select r; dt_PerfmonValue_select = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_PerfmonValue_select.NewRow(); newRow.ItemArray = r.ItemArray; dt_PerfmonValue_select.Rows.Add(newRow);//I'm doubtful if you need to call this or not } } else { var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == strPCID && r.Field <string>("InstanceName") == strInstanceName select r; dt_PerfmonValue_select = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_PerfmonValue_select.NewRow(); newRow.ItemArray = r.ItemArray; dt_PerfmonValue_select.Rows.Add(newRow);//I'm doubtful if you need to call this or not } } ////cloud.R_Windows_Perfmon(ServerNum, dtmStart, dtmEnd, strPCID, strInstanceName); //if (strInstanceName.ToLower() == "allinstance") // cloud.R_Adhoc("select TImeIn,InstanceName,PValue from tbPerfmonValues where TimeIn_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and TimeIn_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum + " and PCID = '" + strPCID + "'"); //else // cloud.R_Adhoc("select TImeIn,InstanceName,PValue from tbPerfmonValues where TimeIn_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and TimeIn_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum + " and PCID = '" + strPCID + "' and InstanceName = '" + strInstanceName + "'"); dt = Func_SetColumn(dt_PerfmonValue_select); strColumnNames = Lib.ConvertingProc.GetColumname(dt.Columns); gv_List.DataSource = dt; gv_List.DataBind(); //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Lines(dt, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); } }
private void BindData() { try { //호스트 정보 가져오기 cloud.R_Adhoc("select ServerNum,HostName,DisplayName,DisplayGroup,RAMSIZE,IPAddress,ServerType,WinVer,Processors,CurrentStatus, TimeIn_UTC from tbHostStatus where ServerNum = " + ServerNum); dt_Server = cloud.dsReturn.Tables[0]; dt_Server = Lib.ConvertingProc.SetDashboardDtServer(dt_Server); //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select a.TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON as a with(nolock) inner join tbHostStatus as b on a.TimeIn_UTC = b.TimeIn_UTC and a.ServerNum = b.ServerNum where b.ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } //dt_FreeDisk 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where (r.Field <string>("PCID") == "P018" || r.Field <string>("PCID") == "P164" || r.Field <string>("PCID") == "P015" || r.Field <string>("PCID") == "P190" || r.Field <string>("PCID") == "P194") && !r.Field <string>("InstanceName").Contains("_Total") && !r.Field <string>("InstanceName").Contains("HarddiskVolume") select r; dt_FreeDisk = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_FreeDisk.NewRow(); newRow.ItemArray = r.ItemArray; dt_FreeDisk.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //MaxDIsk 정보 가져오기 dt_MaxDisk = Lib.ConvertingProc.SetDiskMaxProc(dt_FreeDisk); dt_MaxDisk = Lib.ConvertingProc.SetDashboardDtServer(dt_MaxDisk); //dt_FreeDisk = Lib.ConvertingProc.Pivot(dt_FreeDisk, "InstanceName", "TimeIn", "PValue"); dt_FreeDisk = Lib.ConvertingProc.SetDiskProc(dt_FreeDisk); //여기가 수정 한곳 //윈도우 성능 정보 가져오기 int nReturn = cloud.get_Dashboard_Chart(ServerNum.ToString()); dt_Data = Lib.ConvertingProc.ChangeDashboardColumnName(cloud.dsReturn.Tables[0]); dt_Data = Lib.ConvertingProc.SetDashboardDtServer(dt_Data); //성능 정보에서 최근값을 라벨에 뿌려주기 위해 MaxData 생성해서 마지막 값 읽기 dt_MaxData = new DataTable(); dt_MaxData = dt_Data.Clone(); dt_MaxData.ImportRow(dt_Data.Rows[dt_Data.Rows.Count - 1]); //dt_MaxData = Lib.ConvertingProc.SetDashboardDtServer(dt_MaxData); //차트 데이터 던지기 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_Data, SetChartProperty()); cplst = Lib.Flotr2.SetArrayString_Cols(dt_Data, cplst); cplst = Lib.Flotr2.SetArrayString_Bar(dt_FreeDisk, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript_UC.Text += Lib.Util.BoxingScript(sb.ToString()); } catch { } }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.get_ServerStatus(ServerNum.ToString()); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); } //cloud.R_WEB_Report(Lib.Util.TConverter<int>(ddl_Server.SelectedValue), dtmStart, dtmEnd); //Adhoc으로 던져봄 (tbDashboard 데이터 가져오기) cloud.R_Adhoc("select TimeIn,P0,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19 from tbDashboard where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + " ' and ServerNum = " + ServerNum); //dt = new DataTable(); dt_Data = Lib.ConvertingProc.ChangeDashboardColumnName(cloud.dsReturn.Tables[0]); dt_Data = Lib.ConvertingProc.SetDashboardDtServer(dt_Data); dt_Data = func_MatchColumName(dt_Data); //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } { //dt_FreeDisk 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P018" && !r.Field <string>("InstanceName").Contains("_Total") && !r.Field <string>("InstanceName").Contains("HarddiskVolume") select r; dt_FreeDisk = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_FreeDisk.NewRow(); newRow.ItemArray = r.ItemArray; dt_FreeDisk.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_FreeDisk = Lib.ConvertingProc.SetDiskProc(dt_FreeDisk); //dt_FreeDisk = Lib.ConvertingProc.Pivot(dt_FreeDisk, "Instancename", "TimeIn", "PValue"); //strFreeDiskColumName = Lib.ConvertingProc.GetColumname(dt_FreeDisk.Columns); } { //dt_FreeDiskPercent 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P018" && !r.Field <string>("InstanceName").Contains("_Total") && !r.Field <string>("InstanceName").Contains("HarddiskVolume") select r; dt_FreeDiskPercent = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_FreeDiskPercent.NewRow(); newRow.ItemArray = r.ItemArray; dt_FreeDiskPercent.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_FreeDiskPercent = Lib.ConvertingProc.SetDiskProc(dt_FreeDiskPercent); } List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Line_DualYAxis(dt_Data, cplst); //cplst = Lib.Flotr2.SetArrayString_Pie(dt_FreeDisk_Max, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_FreeDisk, cplst); cplst = Lib.Flotr2.SetArrayString_Lines(dt_Data, cplst); cplst = Lib.Flotr2.SetArrayString_Bar(dt_FreeDiskPercent, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.get_ServerStatus(ServerNum.ToString()); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); } //cloud.R_WEB_TimeTaken(Lib.Util.TConverter<int>(ddl_Server.SelectedValue), dtmStart, dtmEnd); cloud.R_Adhoc("SELECT TOP(20) URI,AVG(AvgTimeTaken) AS [Average Time Taken], MAX(MaxTimeTaken) AS [Max Time Taken] FROM tbIISLog WHERE TimeIn_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + " ' and ServerNum = " + ServerNum + " GROUP BY URI ORDER BY [Average Time Taken] DESC"); DataTable dt_Web_TimeTaken = cloud.dsReturn.Tables[0]; gv_List_AvgTimeTaken.DataSource = dt_Web_TimeTaken; gv_List_MaxTimeTaken.DataSource = dt_Web_TimeTaken; gv_List_AvgTimeTaken.DataBind(); gv_List_MaxTimeTaken.DataBind(); //cloud.R_WEB_Byte(Lib.Util.TConverter<int>(ddl_Server.SelectedValue), dtmStart, dtmEnd); cloud.R_Adhoc("SELECT TOP(20) URI,SUM(CAST(SCBytes AS float)) AS [Total Bytes from Server], SUM(Hits) AS [Total Hits] FROM tbIISLog WHERE TimeIn_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and TimeIn_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + " ' and ServerNum = " + ServerNum + " GROUP BY URI ORDER BY [Total Bytes from Server] DESC"); DataTable dt_Web_Byte = cloud.dsReturn.Tables[0]; gv_List_TotalBytes.DataSource = dt_Web_Byte; gv_List_TotalHit.DataSource = dt_Web_Byte; gv_List_TotalBytes.DataBind(); gv_List_TotalHit.DataBind(); //cloud.R_WEB_RequestStatus(Lib.Util.TConverter<int>(ddl_Server.SelectedValue), dtmStart, dtmEnd); cloud.R_Adhoc("SELECT ValueDescription,LogValue,SUM(TotalNumber) AS [Total] FROM tbIISRequestStatus WHERE TimeIn_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and TimeIn_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + " ' and ServerNum = " + ServerNum + " GROUP BY ValueDescription, LogValue ORDER BY ValueDescription, Total DESC"); DataTable dt_Web_Request = cloud.dsReturn.Tables[0]; DataTable dt_Web_Request_hit = new DataTable(); var query = from data in dt_Web_Request.AsEnumerable() where data["ValueDescription"].ToString() == "TOP 20 Hits" orderby data["Total"] descending select data; if (query.Count() > 0) { dt_Web_Request_hit = query.CopyToDataTable <DataRow>(); dt_Web_Request_hit.Columns["LogValue"].ColumnName = "hit"; } gv_List_Hit.DataSource = dt_Web_Request_hit; gv_List_Hit.DataBind(); DataTable dt_Web_Request_App_hit = new DataTable(); query = from data in dt_Web_Request.AsEnumerable() where data["ValueDescription"].ToString() == "TOP 20 Application Hits" orderby data["Total"] descending select data; if (query.Count() > 0) { dt_Web_Request_App_hit = query.CopyToDataTable <DataRow>(); dt_Web_Request_App_hit.Columns["LogValue"].ColumnName = "App_hit"; } gv_List_App_Hit.DataSource = dt_Web_Request_App_hit; gv_List_App_Hit.DataBind(); DataTable dt_Web_Request_IpAddr = new DataTable(); query = from data in dt_Web_Request.AsEnumerable() where data["ValueDescription"].ToString() == "TOP 20 Clients IP" orderby data["Total"] descending select data; if (query.Count() > 0) { dt_Web_Request_IpAddr = query.CopyToDataTable <DataRow>(); dt_Web_Request_IpAddr.Columns["LogValue"].ColumnName = "IP"; } gv_List_IP.DataSource = dt_Web_Request_IpAddr; gv_List_IP.DataBind(); DataTable dt_Web_Request_BytePerExtension = new DataTable(); query = from data in dt_Web_Request.AsEnumerable() where data["ValueDescription"].ToString() == "TOP 20 Bytes per Extension" orderby data["Total"] descending select data; if (query.Count() > 0) { dt_Web_Request_BytePerExtension = query.CopyToDataTable <DataRow>(); dt_Web_Request_BytePerExtension.Columns["LogValue"].ColumnName = "BytePerExtension"; } gv_List_BytePerExtenstion.DataSource = dt_Web_Request_BytePerExtension; gv_List_BytePerExtenstion.DataBind(); //cloud.R_WEB_Errors(Lib.Util.TConverter<int>(ddl_Server.SelectedValue), dtmStart, dtmEnd); cloud.R_Adhoc("SELECT TOP(20) URI, SUM(Hits) AS [Total Hits], StatusCode as [Status Code], Win32StatusCode as [Win32 Status Code] FROM tbIISLog WHERE TimeIn >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + " ' and ServerNum = " + ServerNum + " and StatusCode >= 400 GROUP BY URI, StatusCode, Win32StatusCode ORDER BY [Total Hits] DESC"); DataTable dt_Error = cloud.dsReturn.Tables[0]; gv_List_Err.DataSource = dt_Error; gv_List_Err.DataBind(); //cloud.R_WEB_ServiceStatus(Lib.Util.TConverter<int>(ddl_Server.SelectedValue), dtmStart, dtmEnd); cloud.R_Adhoc("SELECT SUM(TotalHits) AS [Total Hits], SUM(TotalSCBytes) AS [Total Bytes from Server], SUM(TotalCSBytes) AS [Total Bytes from Clients], SUM(TotalCIP) AS [Total Client IP], SUM(TotalErrors) AS [Total Errors] FROM tbIISServiceStatus WHERE TimeIn >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + " ' and ServerNum = " + ServerNum); DataTable dt_ServiceStatus = cloud.dsReturn.Tables[0]; gv_List_ServiceStatus.DataSource = dt_ServiceStatus; gv_List_ServiceStatus.DataBind(); //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = Lib.Flotr2.SetArrayString_Cols_Horizon(dt_Web_TimeTaken, SetChartProperty()); cplst = Lib.Flotr2.SetArrayString_Cols_Horizon(dt_Web_Byte, cplst); cplst = Lib.Flotr2.SetArrayString_Cols_Horizon(dt_Web_Request_hit, cplst); cplst = Lib.Flotr2.SetArrayString_Cols_Horizon(dt_Web_Request_App_hit, cplst); cplst = Lib.Flotr2.SetArrayString_Cols_Horizon(dt_Web_Request_BytePerExtension, cplst); cplst = Lib.Flotr2.SetArrayString_Cols_Horizon(dt_Web_Request_IpAddr, cplst); //cplst = Lib.Flotr2.SetArrayString_Lines(dt, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.R_HostInfo(Lib.Util.TConverter <int>(ddl_Server.SelectedValue)); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); } //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } { //dt_FreeSpace_per 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P164" select r; dt_FreeSpace_per = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_FreeSpace_per.NewRow(); newRow.ItemArray = r.ItemArray; dt_FreeSpace_per.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_FreeSpace_per = Lib.ConvertingProc.SetDiskProc(dt_FreeSpace_per); dt_FreeSpace_per = Lib.ConvertingProc.Pivot(dt_FreeSpace_per, "Instancename", "TimeIn", "Pvalue"); strColumnName_FreeDiskPer = Lib.ConvertingProc.GetColumname(dt_FreeSpace_per.Columns); } { //dt_FreeSpace_byte 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P018" select r; dt_FreeSpace_byte = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_FreeSpace_byte.NewRow(); newRow.ItemArray = r.ItemArray; dt_FreeSpace_byte.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_FreeSpace_byte = Lib.ConvertingProc.SetDiskProc(dt_FreeSpace_byte); dt_FreeSpace_byte = Lib.ConvertingProc.Pivot(dt_FreeSpace_byte, "Instancename", "TimeIn", "Pvalue"); strColumnName_FreeDiskByte = Lib.ConvertingProc.GetColumname(dt_FreeSpace_byte.Columns); } { //dt_DiskTime 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P015" select r; dt_DiskTime = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_DiskTime.NewRow(); newRow.ItemArray = r.ItemArray; dt_DiskTime.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_DiskTime = Lib.ConvertingProc.SetDiskProc(dt_DiskTime); dt_DiskTime = Lib.ConvertingProc.Pivot(dt_DiskTime, "Instancename", "TimeIn", "Pvalue"); strColumName_DiskTime = Lib.ConvertingProc.GetColumname(dt_DiskTime.Columns); } { //dt_DiskIdleTime 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P190" select r; dt_DiskIdleTime = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_DiskIdleTime.NewRow(); newRow.ItemArray = r.ItemArray; dt_DiskIdleTime.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_DiskIdleTime = Lib.ConvertingProc.SetDiskProc(dt_DiskIdleTime); dt_DiskIdleTime = Lib.ConvertingProc.Pivot(dt_DiskIdleTime, "Instancename", "TimeIn", "Pvalue"); strColumName_DiskIdleTime = Lib.ConvertingProc.GetColumname(dt_DiskIdleTime.Columns); } { //dt_AvgDiskRead 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P191" select r; dt_AvgDiskRead = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_AvgDiskRead.NewRow(); newRow.ItemArray = r.ItemArray; dt_AvgDiskRead.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_AvgDiskRead = Lib.ConvertingProc.SetDiskProc(dt_AvgDiskRead); dt_AvgDiskRead = Lib.ConvertingProc.Pivot(dt_AvgDiskRead, "Instancename", "TimeIn", "Pvalue"); strColumName_AvDiskRead = Lib.ConvertingProc.GetColumname(dt_AvgDiskRead.Columns); } { //dt_AvgDiskWrite 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P193" select r; dt_AvgDiskWrite = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_AvgDiskWrite.NewRow(); newRow.ItemArray = r.ItemArray; dt_AvgDiskWrite.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_AvgDiskWrite = Lib.ConvertingProc.SetDiskProc(dt_AvgDiskWrite); dt_AvgDiskWrite = Lib.ConvertingProc.Pivot(dt_AvgDiskWrite, "Instancename", "TimeIn", "Pvalue"); strColumName_AvgDiskWrite = Lib.ConvertingProc.GetColumname(dt_AvgDiskWrite.Columns); } { //dt_AvgDiskReadQueue 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P197" select r; dt_AvgDiskReadQueue = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_AvgDiskReadQueue.NewRow(); newRow.ItemArray = r.ItemArray; dt_AvgDiskReadQueue.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_AvgDiskReadQueue = Lib.ConvertingProc.SetDiskProc(dt_AvgDiskReadQueue); dt_AvgDiskReadQueue = Lib.ConvertingProc.Pivot(dt_AvgDiskReadQueue, "Instancename", "TimeIn", "Pvalue"); strColumName_AvgDiskReadQueueLength = Lib.ConvertingProc.GetColumname(dt_AvgDiskReadQueue.Columns); } { //dt_AvgDiskWriteQueue 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P198" select r; dt_AvgDiskWriteQueue = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_AvgDiskWriteQueue.NewRow(); newRow.ItemArray = r.ItemArray; dt_AvgDiskWriteQueue.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_AvgDiskWriteQueue = Lib.ConvertingProc.SetDiskProc(dt_AvgDiskWriteQueue); dt_AvgDiskWriteQueue = Lib.ConvertingProc.Pivot(dt_AvgDiskWriteQueue, "Instancename", "TimeIn", "Pvalue"); strColumName_AvgDiskWriteQueueLength = Lib.ConvertingProc.GetColumname(dt_AvgDiskWriteQueue.Columns); } { //dt_AvgDiskQueue 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P017" select r; dt_AvgDiskQueue = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_AvgDiskQueue.NewRow(); newRow.ItemArray = r.ItemArray; dt_AvgDiskQueue.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_AvgDiskQueue = Lib.ConvertingProc.SetDiskProc(dt_AvgDiskQueue); dt_AvgDiskQueue = Lib.ConvertingProc.Pivot(dt_AvgDiskQueue, "Instancename", "TimeIn", "Pvalue"); strColumnName_AvgDiskQueueLength = Lib.ConvertingProc.GetColumname(dt_AvgDiskQueue.Columns); } { //dt_CurruntQueue 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P194" select r; dt_CurruntQueue = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_CurruntQueue.NewRow(); newRow.ItemArray = r.ItemArray; dt_CurruntQueue.Rows.Add(newRow);//I'm doubtful if you need to call this or not } //dt_CurruntQueue = Lib.ConvertingProc.SetDiskProc(dt_CurruntQueue); dt_CurruntQueue = Lib.ConvertingProc.Pivot(dt_CurruntQueue, "Instancename", "TimeIn", "Pvalue"); strColumnName_CurrentDiskQueueLength = Lib.ConvertingProc.GetColumname(dt_CurruntQueue.Columns); } //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_FreeSpace_per, cplst, "FREEDISKSPACEPER_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_FreeSpace_byte, cplst, "FREEDISKSPACEMB_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_DiskTime, cplst, "DISKTIMEMS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_DiskIdleTime, cplst, "DISKIDLETIME_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_AvgDiskRead, cplst, "AVGDISKREAD_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_AvgDiskWrite, cplst, "AVGDISKWRITE_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_AvgDiskReadQueue, cplst, "AVGDISKREADQUEUE_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_AvgDiskWriteQueue, cplst, "AVGDISKWRITEQUEUE_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_AvgDiskQueue, cplst, "AVGDISKQUEUE_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_CurruntQueue, cplst, "CURRENTDISKQUEUE_LINE_CHART"); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindSql() { pnl_SQL.Visible = true; //gv2 //실행 쿼리 데이터 읽어오기 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbSQLCurrentExecution_JSON where Timein_UTC = '" + dtmTimeIn_UTC.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_SQLQuery = tester.Clone(); dt_SQLQuery.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_SQLQuery.Merge(dt_tmp); } } { //dt_SQLCurrentQuery 데이터 테이블 만들기 var test = (from r in dt_SQLQuery.AsEnumerable() orderby r.Field <Int64>("cpu_time") descending select r).Take(20); foreach (DataRow r in test) { var newRow = dt_SQLCurrentQuery.NewRow(); newRow.ItemArray = r.ItemArray; dt_SQLCurrentQuery.Rows.Add(newRow);//I'm doubtful if you need to call this or not } rpt_Query.DataSource = dt_SQLCurrentQuery; rpt_Query.DataBind(); } //label 이름 cloud.w_ChartSubject(CompanyNum, MemberNum, strReasonCode); DataTable dt_ChartSubject = cloud.dsReturn.Tables[0]; if (dt_ChartSubject != null) { if (dt_ChartSubject.Rows.Count > 0) { lbl_Sql.Text = dt_ChartSubject.Rows[0][0].ToString(); lbl_Sql_Sub.Text = dt_ChartSubject.Rows[0][0].ToString(); } } //gv1 cloud.w_AlertDetail_Table(CompanyNum, MemberNum, ServerNum, strInstanceName, strReasonCode); DataTable dt_Descript = cloud.dsReturn.Tables[0]; gv_List_Sql.DataSource = dt_Descript; gv_List_Sql.DataBind(); //chart cloud.w_AlertDetail_Chart(CompanyNum, MemberNum, ServerNum, strInstanceName, strReasonCode); DataTable dt_ChartValue = cloud.dsReturn.Tables[0]; //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty_SQL(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_ChartValue, cplst); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript_Pop.Text += Lib.Util.BoxingScript(sb.ToString()); }
private void BindData() { DataTable dt = new DataTable(); if (!string.IsNullOrEmpty(ddl_Server.SelectedValue)) { cloud.R_HostInfo(Lib.Util.TConverter <int>(ddl_Server.SelectedValue)); dt = cloud.dsReturn.Tables[0]; gv_Info.DataSource = dt; gv_Info.DataBind(); cloud.w_SQLDatabasesDetail(Lib.Util.TConverter <int>(ddl_Server.SelectedValue)); gv_List.DataSource = cloud.dsReturn.Tables[0]; gv_List.DataBind(); } int numDuration = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ChartDataDuration"]); //각 차트에서 참조해서 사용할 공통 데이터 테이블 생성 cloud.R_Adhoc("select TimeIn_UTC, Data_JSON from tbPerfmonValues_JSON where Timein_UTC >= '" + dtmStart.ToString("yyyy-MM-dd HH:mm:ss") + "' and Timein_UTC < '" + dtmEnd.ToString("yyyy-MM-dd HH:mm:ss") + "' and ServerNum = " + ServerNum); //신규추가 2017-09-23 if (cloud.dsReturn.Tables[0].Rows.Count > 0) { //데이터 테이블 구조생성용으로 첫번째 json데이터를 불러와서 컬럼명을 자동셋팅하도록 DataTable tester = (DataTable)JsonConvert.DeserializeObject(((string)cloud.dsReturn.Tables[0].Rows[0]["Data_Json"]), (typeof(DataTable))); //tester 에는 실제로 데이터가 들어가잇고 clone 을 이용해 dt_Struct 에 데이터테이블 구조만 복사 //DataTable dt_struct = new DataTable(); dt_PerfmonValue = tester.Clone(); dt_PerfmonValue.AcceptChanges(); // 이후 dt_struct 에 계속 merge (union) 하여 하나로 합체 테스트로 돌려보니 rowcount 8만 정도 나왓네요 foreach (DataRow dr in cloud.dsReturn.Tables[0].Rows) { DataTable dt_tmp = (DataTable)JsonConvert.DeserializeObject(((string)dr["Data_Json"]), (typeof(DataTable))); //신규추가 2017-09-23 데이터 머지 = mssql union //신규추가 2017-09-23 참조 https://msdn.microsoft.com/ko-kr/library/fk68ew7b(v=vs.110).aspx dt_PerfmonValue.Merge(dt_tmp); } } { //dt_ACTIVETRANSACTIONS 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P114" select r; dt_ACTIVETRANSACTIONS = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_ACTIVETRANSACTIONS.NewRow(); newRow.ItemArray = r.ItemArray; dt_ACTIVETRANSACTIONS.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_ACTIVETRANSACTIONS = Lib.ConvertingProc.Pivot(dt_ACTIVETRANSACTIONS, "Instancename", "TimeIn", "Pvalue"); strColumn_ACTIVETRANSACTIONS = Lib.ConvertingProc.GetColumname(dt_ACTIVETRANSACTIONS.Columns); } { //dt_LOGCACHEHITRATIO 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P169" select r; dt_LOGCACHEHITRATIO = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGCACHEHITRATIO.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGCACHEHITRATIO.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGCACHEHITRATIO = Lib.ConvertingProc.Pivot(dt_LOGCACHEHITRATIO, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGCACHEHITRATIO = Lib.ConvertingProc.GetColumname(dt_LOGCACHEHITRATIO.Columns); } { //dt_LOGCACHEHITRATIO 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P120" select r; dt_LOGBYTESFLUSHEDSEC = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGBYTESFLUSHEDSEC.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGBYTESFLUSHEDSEC.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGBYTESFLUSHEDSEC = Lib.ConvertingProc.Pivot(dt_LOGBYTESFLUSHEDSEC, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGBYTESFLUSHEDSEC = Lib.ConvertingProc.GetColumname(dt_LOGBYTESFLUSHEDSEC.Columns); } { //dt_LOGFLUSHWAITTIME 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P121" select r; dt_LOGFLUSHWAITTIME = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGFLUSHWAITTIME.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGFLUSHWAITTIME.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGFLUSHWAITTIME = Lib.ConvertingProc.Pivot(dt_LOGFLUSHWAITTIME, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGFLUSHWAITTIME = Lib.ConvertingProc.GetColumname(dt_LOGFLUSHWAITTIME.Columns); } { //dt_LOGFLUSHWAITTIME 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P118" select r; dt_LOGFLUSHWAITSSEC = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGFLUSHWAITSSEC.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGFLUSHWAITSSEC.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGFLUSHWAITSSEC = Lib.ConvertingProc.Pivot(dt_LOGFLUSHWAITSSEC, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGFLUSHWAITSSEC = Lib.ConvertingProc.GetColumname(dt_LOGFLUSHWAITSSEC.Columns); } { //dt_LOGFLUSHESSEC 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P119" select r; dt_LOGFLUSHESSEC = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGFLUSHESSEC.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGFLUSHESSEC.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGFLUSHESSEC = Lib.ConvertingProc.Pivot(dt_LOGFLUSHESSEC, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGFLUSHESSEC = Lib.ConvertingProc.GetColumname(dt_LOGFLUSHESSEC.Columns); } { //dt_LOGGROWTHS 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P122" select r; dt_LOGGROWTHS = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGGROWTHS.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGGROWTHS.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGGROWTHS = Lib.ConvertingProc.Pivot(dt_LOGGROWTHS, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGGROWTHS = Lib.ConvertingProc.GetColumname(dt_LOGGROWTHS.Columns); } { //dt_LOGSHRINKS 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P123" select r; dt_LOGSHRINKS = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGSHRINKS.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGSHRINKS.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGSHRINKS = Lib.ConvertingProc.Pivot(dt_LOGSHRINKS, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGSHRINKS = Lib.ConvertingProc.GetColumname(dt_LOGSHRINKS.Columns); } { //dt_LOGSHRINKS 데이터 테이블 만들기 var test = from r in dt_PerfmonValue.AsEnumerable() where r.Field <string>("PCID") == "P124" select r; dt_LOGTRUNCATIONS = dt_PerfmonValue.Clone(); foreach (DataRow r in test) { var newRow = dt_LOGTRUNCATIONS.NewRow(); newRow.ItemArray = r.ItemArray; dt_LOGTRUNCATIONS.Rows.Add(newRow);//I'm doubtful if you need to call this or not } dt_LOGTRUNCATIONS = Lib.ConvertingProc.Pivot(dt_LOGTRUNCATIONS, "Instancename", "TimeIn", "Pvalue"); strColumn_LOGTRUNCATIONS = Lib.ConvertingProc.GetColumname(dt_LOGTRUNCATIONS.Columns); } //챠트바인드 List <Lib.chartProperty> cplst = new List <Lib.chartProperty>(); StringBuilder sb = new StringBuilder(); cplst = SetChartProperty(); cplst = Lib.Flotr2.SetArrayString_Lines(dt_ACTIVETRANSACTIONS, cplst, "ACTIVETRANSACTIONS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGCACHEHITRATIO, cplst, "LOGCACHEHITRATIO_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGBYTESFLUSHEDSEC, cplst, "LOGBYTESFLUSHEDSEC_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGFLUSHWAITTIME, cplst, "LOGFLUSHWAITTIME_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGFLUSHWAITSSEC, cplst, "LOGFLUSHWAITSSEC_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGFLUSHESSEC, cplst, "LOGFLUSHESSEC_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGGROWTHS, cplst, "LOGGROWTHS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGSHRINKS, cplst, "LOGSHRINKS_LINE_CHART"); cplst = Lib.Flotr2.SetArrayString_Lines(dt_LOGTRUNCATIONS, cplst, "LOGTRUNCATIONS_LINE_CHART"); sb = Lib.Flotr2.SetStringValue(cplst, sb, ServerNum.ToString()); litScript.Text += Lib.Util.BoxingScript(sb.ToString()); }