17 void df027_SQliteDependencyOverVersion () {
19 auto rdfb = ROOT::RDF::MakeSqliteDataFrame(
"http://root.cern/files/root_download_stats.sqlite",
"SELECT * FROM accesslog;" );
21 auto minTimeStr = *rdfb.Reduce([](std::string a, std::string b) {
return std::min(a, b);},
"Time", std::string(
"Z"));
23 std::cout <<
"Minimum time is '" << minTimeStr <<
"'" << std::endl;
25 double minTime = TDatime(minTimeStr.c_str()).Convert();
26 double now = TDatime().Convert();
28 auto rdf = rdfb.Define(
"datime", [](
const std::string &time){
return TDatime(time.c_str()).Convert();}, {
"Time"});
30 auto h614 = rdf.Filter([](
const std::string &v){
return 0 == v.find(
"6.14");}, {
"Version"})
31 .Histo1D({
"h614",
"Download time for version 6.14", 16, minTime, now}, {
"datime"});
33 auto h616 = rdf.Filter([](
const std::string &v){
return 0 == v.find(
"6.16");}, {
"Version"})
34 .Histo1D({
"h616",
"Download time for version 6.16", 16, minTime, now}, {
"datime"});
36 auto h618 = rdf.Filter([](
const std::string &v){
return 0 == v.find(
"6.18");}, {
"Version"})
37 .Histo1D({
"h618",
"Download time for version 6.18", 16, minTime, now}, {
"datime"});
41 auto histoList = {h614, h616, h618};
42 auto canvases =
new std::vector<TCanvas*>(histoList.size());
44 gStyle->SetTimeOffset(0);
45 gStyle->SetOptStat(0);
47 for (
auto histo : histoList) {
48 canvases->at(histoIdx) =
new TCanvas();
49 histo->GetXaxis()->LabelsOption(
"v");
50 histo->GetXaxis()->SetTimeDisplay(1);
51 histo->GetXaxis()->SetLabelSize(0.02);
52 histo->GetXaxis()->SetNdivisions(512, kFALSE);
53 histo->GetXaxis()->SetTimeFormat(
"%Y-%m-%d");