diff --git a/config/grafana/ASAP__O.json b/config/grafana/ASAP__O.json index c8fcc21216b9127aeb6ec3c78efb8e74e9040f7b..7ed15c7eeef11c48042a4040e9350637865b477f 100644 --- a/config/grafana/ASAP__O.json +++ b/config/grafana/ASAP__O.json @@ -244,32 +244,6 @@ ] ], "tags": [] - }, - { - "alias": "Database", - "groupBy": [], - "measurement": "statistics", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "db_share" - ], - "type": "field" - }, - { - "params": [ - " *data_volume/ elapsed_ms/1024/1024/1024*1000*8" - ], - "type": "math" - } - ] - ], - "tags": [] } ], "thresholds": [], @@ -341,7 +315,7 @@ "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, "targets": [ { @@ -481,5 +455,5 @@ "timezone": "", "title": "ASAP::O", "uid": "3JvTwliiz", - "version": 3 + "version": 4 } \ No newline at end of file diff --git a/examples/worker/getnext_broker/getnext_broker.cpp b/examples/worker/getnext_broker/getnext_broker.cpp index fc00c718fe84c70094853e4cc27107b6221532d5..726c6410281ea2d4c8a685744c71b9be64d46b83 100644 --- a/examples/worker/getnext_broker/getnext_broker.cpp +++ b/examples/worker/getnext_broker/getnext_broker.cpp @@ -18,17 +18,18 @@ void WaitThreads(std::vector<std::thread>* threads) { } } -void ProcessError(const Error& err) { - if (err == nullptr) return; +int ProcessError(const Error& err) { + if (err == nullptr) return 0; if (err->GetErrorType() != hidra2::ErrorType::kEndOfFile) { std::cout << err->Explain() << std::endl; - exit(EXIT_FAILURE); + return 1; } + return 0; } std::vector<std::thread> StartThreads(const std::string& server, const std::string& run_name, int nthreads, - std::vector<int>* nfiles) { - auto exec_next = [server, run_name, nfiles](int i) { + std::vector<int>* nfiles, std::vector<int>* errors) { + auto exec_next = [server, run_name, nfiles, errors](int i) { hidra2::FileInfo fi; Error err; auto broker = hidra2::DataBrokerFactory::CreateServerBroker(server, run_name, &err); @@ -36,7 +37,7 @@ std::vector<std::thread> StartThreads(const std::string& server, const std::stri while ((err = broker->GetNext(&fi, nullptr)) == nullptr) { (*nfiles)[i] ++; } - ProcessError(err); + (*errors)[i] = ProcessError(err); }; std::vector<std::thread> threads; @@ -51,11 +52,16 @@ int ReadAllData(const std::string& server, const std::string& run_name, int nthr high_resolution_clock::time_point t1 = high_resolution_clock::now(); std::vector<int>nfiles(nthreads, 0); + std::vector<int>errors(nthreads, 0); - auto threads = StartThreads(server, run_name, nthreads, &nfiles); + auto threads = StartThreads(server, run_name, nthreads, &nfiles, &errors); WaitThreads(&threads); int n_total = std::accumulate(nfiles.begin(), nfiles.end(), 0); + int errors_total = std::accumulate(errors.begin(), errors.end(), 0); + if (errors_total) { + exit(EXIT_FAILURE); + } high_resolution_clock::time_point t2 = high_resolution_clock::now(); auto duration_read = std::chrono::duration_cast<std::chrono::milliseconds>( t2 - t1 ); diff --git a/tests/automatic/broker/get_next/check_linux_.sh b/tests/automatic/broker/get_next/check_linux_.sh deleted file mode 100755 index a701ba97b8107cf2cbe62393ab48daeabe3d9e34..0000000000000000000000000000000000000000 --- a/tests/automatic/broker/get_next/check_linux_.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -database_name=data - -echo "db.data.insert({"_id":2})" | mongo ${database_name} -echo "db.data.insert({"_id":1})" | mongo ${database_name} -