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()); }