Changeset 19136 for trunk/FACT++/src/rootifysql.cc
- Timestamp:
- 08/03/18 20:53:39 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/rootifysql.cc
r19134 r19136 35 35 ("ignore", vars<string>(), "Ignore the given columns") 36 36 ("display,d", po_switch(), "Displays contents on the screen (most usefull in combination with mysql statements as SHOW or EXPLAIN)") 37 ("write ",var<string>(""), "Write output to an ascii file")37 ("write,w", var<string>(""), "Write output to an ascii file") 38 38 ("null,n", po_switch(), "Redirect the output file to /dev/null (mainly for debugging purposes, e.g. performance studies)") 39 39 ("no-fill", po_switch(), "Do not fill events into the root file (mainly for debugging purposes, e.g. performance studies)") … … 446 446 if (!l.empty() && l[0]!='#') 447 447 envs[ident].push_back(line); 448 } 448 449 449 450 if (verbose>0) … … 499 500 Database connection(uri); // Keep alive while fetching rows 500 501 502 if (verbose>0) 503 { 504 cout << "Client Version: " << connection.client_version() << '\n'; 505 cout << "Server Version: " << connection.server_version() << endl; 506 } 507 501 508 if (print_connection) 502 509 { … … 511 518 catch (const exception &e) 512 519 { 513 cerr << "\nSHOW STATUS LIKE COMPRESSION\n\n";520 cerr << "\nSHOW STATUS LIKE 'Compression'\n\n"; 514 521 cerr << "SQL query failed:\n" << e.what() << endl; 515 522 return 6; … … 650 657 651 658 if (verbose>0) 652 cout << "Opening file '" << path << "' [compression=" << compression << "]..." << endl; 659 { 660 cout << "Opening file '" << path << "' [compression=" << compression << "]...\n"; 661 cout << "Writing data to tree '" << tree << "'" << endl; 662 } 653 663 654 664 // ----------------------------- Open output file -------------------------- … … 931 941 } 932 942 943 if (print_connection) 944 { 945 try 946 { 947 const auto &res1 = connection.query("SHOW STATUS LIKE 'Bytes_%'").store(); 948 cout << left << setw(16) << res1[0]["Variable_name"] << ' ' << Tools::Scientific(res1[0]["Value"]) << endl; 949 cout << left << setw(16) << res1[1]["Variable_name"] << ' ' << Tools::Scientific(res1[1]["Value"]) << endl; 950 cout << endl; 951 } 952 catch (const exception &e) 953 { 954 cerr << "\nSHOW STATUS LIKE 'Bytes_%'\n\n"; 955 cerr << "SQL query failed:\n" << e.what() << endl; 956 return 6; 957 } 958 } 959 933 960 return 0; 934 961 }
Note:
See TracChangeset
for help on using the changeset viewer.