summaryrefslogtreecommitdiff
path: root/dtrain/dtrain.h
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-11-11 11:28:24 +0100
committerPatrick Simianer <p@simianer.de>2011-11-11 11:28:24 +0100
commit7fdee2f485e79d932449827ad11eeee5b9b51eb0 (patch)
tree00c434496ba08b504ab4b141e5a4d19d5b77ed7a /dtrain/dtrain.h
parent4912307c89b3f4e96f7375acf025823efda4a2d3 (diff)
better hstreaming reporting, new hstreaming wrapper
Diffstat (limited to 'dtrain/dtrain.h')
-rw-r--r--dtrain/dtrain.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/dtrain/dtrain.h b/dtrain/dtrain.h
index 6742f343..84f3f1f5 100644
--- a/dtrain/dtrain.h
+++ b/dtrain/dtrain.h
@@ -52,6 +52,25 @@ inline void split_in(string& s, vector<string>& parts)
s.erase(0, f+1);
}
+struct HSReporter
+{
+ string task_id_;
+
+ HSReporter(string task_id) : task_id_(task_id) {}
+ inline void update_counter(string name, weight_t amount) {
+ cerr << "reporter:counter:" << task_id_ << "," << name << "," << amount << endl;
+ }
+ inline void update_counter(string name, unsigned amount) {
+ cerr << "reporter:counter:" << task_id_ << "," << name << "," << amount << endl;
+ }
+ inline void update_gcounter(string name, weight_t amount) {
+ cerr << "reporter:counter:Global," << name << "," << amount << endl;
+ }
+ inline void update_gcounter(string name, unsigned amount) {
+ cerr << "reporter:counter:Global," << name << "," << amount << endl;
+ }
+};
+
inline ostream& _np(ostream& out) { return out << resetiosflags(ios::showpos); }
inline ostream& _p(ostream& out) { return out << setiosflags(ios::showpos); }
inline ostream& _p2(ostream& out) { return out << setprecision(2); }