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
commit606750f2487ed294dcdadcd99638eb5de80d1a0c (patch)
tree5d0335aed54a5bc2ef915839f8b97160ae237a74 /dtrain/dtrain.h
parentea5a05f38887739226c3de4160fafced003cdf85 (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); }