@@ -170,12 +170,12 @@ double ADOutlierSSTD::computeScore(CallListIterator_t ev, const SstdParam &stats
170170unsigned long ADOutlierSSTD::compute_outliers (Anomalies &outliers,
171171 const unsigned long func_id,
172172 std::vector<CallListIterator_t>& data){
173- std::cout << " Finding outliers in events for func " << func_id << std::endl;
173+ verboseStream << " Finding outliers in events for func " << func_id << std::endl;
174174
175175
176176 SstdParam& param = *(SstdParam*)m_param;
177177 if (param[func_id].count () < 2 ){
178- std::cout << " Less than 2 events in stats associated with that func, stats not complete" << std::endl;
178+ verboseStream << " Less than 2 events in stats associated with that func, stats not complete" << std::endl;
179179 return 0 ;
180180 }
181181 unsigned long n_outliers = 0 ;
@@ -194,15 +194,15 @@ unsigned long ADOutlierSSTD::compute_outliers(Anomalies &outliers,
194194 itt->set_outlier_score (computeScore (itt, param));
195195
196196 if (label == -1 ) {
197- std::cout << " !!!!!!!Detected outlier on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid ()
197+ verboseStream << " !!!!!!!Detected outlier on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid ()
198198 << " runtime " << runtime << " mean " << mean << " std " << std << std::endl;
199199 n_outliers += 1 ;
200200 std::vector<double > sstd_stats{thr_hi, thr_lo, mean, std};
201201 outliers.insert (itt, Anomalies::EventType::Outlier, sstd_stats); // insert into data structure containing captured anomalies
202202 }else {
203203 // Capture maximum of one normal execution per io step
204204 if (outliers.nFuncEvents (func_id, Anomalies::EventType::Normal) == 0 ){
205- std::cout << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid ()
205+ verboseStream << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid ()
206206 << " runtime " << runtime << " mean " << mean << " std " << std << std::endl;
207207
208208 outliers.insert (itt, Anomalies::EventType::Normal);
@@ -302,7 +302,7 @@ unsigned long ADOutlierHBOS::compute_outliers(Anomalies &outliers,
302302 const unsigned long func_id,
303303 std::vector<CallListIterator_t>& data){
304304
305- std::cout << " Finding outliers in events for func " << func_id << std::endl;
305+ verboseStream << " Finding outliers in events for func " << func_id << std::endl;
306306
307307 HbosParam& param = *(HbosParam*)m_param;
308308
@@ -448,7 +448,7 @@ unsigned long ADOutlierHBOS::compute_outliers(Anomalies &outliers,
448448 if (ad_score >= l_threshold) {
449449
450450 itt->set_label (-1 );
451- std::cout << " !!!!!!!Detected outlier on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
451+ verboseStream << " !!!!!!!Detected outlier on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
452452 outliers.insert (itt, Anomalies::EventType::Outlier, runtime_i, ad_score, l_threshold); // insert into data structure containing captured anomalies
453453 n_outliers += 1 ;
454454
@@ -458,9 +458,8 @@ unsigned long ADOutlierHBOS::compute_outliers(Anomalies &outliers,
458458 // Capture maximum of one normal execution per io step
459459 itt->set_label (1 );
460460 if (outliers.nFuncEvents (func_id, Anomalies::EventType::Normal) == 0 ) {
461- std::cout << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
462- outliers.insert (itt, Anomalies::EventType::Normal);
463-
461+ verboseStream << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
462+ outliers.insert (itt, Anomalies::EventType::Normal);
464463 }
465464
466465 }
@@ -579,7 +578,7 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
579578 const unsigned long func_id,
580579 std::vector<CallListIterator_t>& data){
581580
582- std::cout << " Finding outliers in events for func " << func_id << std::endl;
581+ verboseStream << " Finding outliers in events for func " << func_id << std::endl;
583582
584583 CopodParam& param = *(CopodParam*)m_param;
585584
@@ -678,7 +677,7 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
678677 if (ad_score >= l_threshold) {
679678
680679 itt->set_label (-1 );
681- std::cout << " !!!!!!!Detected outlier on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
680+ verboseStream << " !!!!!!!Detected outlier on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
682681 outliers.insert (itt, Anomalies::EventType::Outlier, runtime_i, ad_score, l_threshold); // insert into data structure containing captured anomalies
683682 n_outliers += 1 ;
684683
@@ -687,9 +686,8 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
687686 // Capture maximum of one normal execution per io step
688687 itt->set_label (1 );
689688 if (outliers.nFuncEvents (func_id, Anomalies::EventType::Normal) == 0 ) {
690- std::cout << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
691- outliers.insert (itt, Anomalies::EventType::Normal);
692-
689+ verboseStream << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
690+ outliers.insert (itt, Anomalies::EventType::Normal);
693691 }
694692
695693 }
0 commit comments