62 lines
2.4 KiB
C
62 lines
2.4 KiB
C
void MultiThComp() {
|
|
gROOT->SetBatch(kTRUE);
|
|
auto epoll_filename = "./epoll_data_stats_1000_TIMEOUT_HARD.csv";
|
|
auto epoll_df = ROOT::RDF::MakeCsvDataFrame(epoll_filename, true, ';');
|
|
auto epoll_nc = epoll_df.Define("bandwidth", "( total_received_data/static_cast<double>(1024) ) / (time/1000)").Define("bf_kb", "buffer_size/static_cast<double>(1024)");
|
|
|
|
auto epoll_multi_filename = "./epoll_data_stats_1000_multith_TIMEOUT_HARD.csv";
|
|
auto epoll_multi_df = ROOT::RDF::MakeCsvDataFrame(epoll_multi_filename, true, ';');
|
|
auto epoll_multi_nc = epoll_multi_df.Define("bandwidth", "( total_received_data/static_cast<double>(1024) ) / (time/1000)").Define("bf_kb", "buffer_size/static_cast<double>(1024)");
|
|
|
|
auto canvas = new TCanvas("c", "c", 1400, 1000);
|
|
//canvas->SetLogx();
|
|
canvas->SetGrid();
|
|
//canvas->SetLogy();
|
|
|
|
auto epoll_g = epoll_nc.Graph("bf_kb", "bandwidth");
|
|
epoll_g->SetTitle("Epoll vs Epoll Multithread (99.8% long timeouts): 1000 clients;Buffer Size [kB];Bandwidth [kB/s]");
|
|
epoll_g->SetName("epoll");
|
|
epoll_g->SetMarkerStyle(55);
|
|
epoll_g->SetMarkerSize(2);
|
|
epoll_g->SetMarkerColor(kBlue);
|
|
epoll_g->SetLineColor(kBlue);
|
|
epoll_g->SetLineWidth(2);
|
|
|
|
|
|
//epoll_g->GetXaxis()->SetLimits(-50,1000);
|
|
epoll_g->GetHistogram()->SetMinimum(0);
|
|
epoll_g->GetHistogram()->SetMaximum(7000);
|
|
|
|
epoll_g->DrawClone("ALP");
|
|
|
|
auto epoll_multi_g = epoll_multi_nc.Graph("bf_kb", "bandwidth");
|
|
epoll_multi_g->SetTitle("Epoll vs Epoll Multithread (99.8% long timeouts): 1000 clients;Buffer Size [kB];Bandwidth [kB/s]");
|
|
epoll_multi_g->SetName("epoll_multi");
|
|
epoll_multi_g->SetMarkerStyle(55);
|
|
epoll_multi_g->SetMarkerSize(2);
|
|
epoll_multi_g->SetMarkerColor(8);
|
|
epoll_multi_g->SetLineColor(8);
|
|
epoll_multi_g->SetLineWidth(2);
|
|
|
|
|
|
//epoll_multi_g->GetXaxis()->SetLimits(-50,1000);
|
|
//epoll_multi_g->GetHistogram()->SetMinimum(1e3);
|
|
//epoll_multi_g->GetHistogram()->SetMaximum(1e7);
|
|
|
|
epoll_multi_g->DrawClone("LP");
|
|
|
|
//gStyle->SetLegendTextSize(0.01);
|
|
|
|
auto leg = new TLegend(0.60,0.17,0.86,0.32);
|
|
leg->SetHeader("Connection method", "c");
|
|
leg->AddEntry("epoll","Epoll Single Thread","lp");
|
|
leg->AddEntry("epoll_multi","Epoll 6 Threads","lp");
|
|
leg->Draw();
|
|
|
|
//canvas->BuildLegend(0.65,0.2,0.86,0.32, "Connection Method");
|
|
|
|
canvas->Print("Epoll_Multi_1000_TIMEOUT_HARD.png");
|
|
|
|
gROOT->SetBatch(kFALSE);
|
|
gApplication->Terminate(0);
|
|
} |