add first simple benchmark reader (it simply spews random data, amount of lines specified in source).

This commit is contained in:
Bernhard Amann 2012-03-26 12:20:39 -07:00
parent 872ad195f7
commit 9732859d44
6 changed files with 256 additions and 11 deletions

View file

@ -0,0 +1,47 @@
// See the file "COPYING" in the main distribution directory for copyright.
#ifndef INPUT_READERS_BENCHMARK_H
#define INPUT_READERS_BENCHMARK_H
#include "../ReaderBackend.h"
namespace input { namespace reader {
class Benchmark : public ReaderBackend {
public:
Benchmark(ReaderFrontend* frontend);
~Benchmark();
static ReaderBackend* Instantiate(ReaderFrontend* frontend) { return new Benchmark(frontend); }
protected:
virtual bool DoInit(string path, int mode, int arg_num_fields, const threading::Field* const* fields);
virtual void DoFinish();
virtual bool DoUpdate();
private:
virtual bool DoHeartbeat(double network_time, double current_time);
unsigned int num_fields;
const threading::Field* const * fields; // raw mapping
threading::Value* EntryToVal(TypeTag Type, TypeTag subtype);
int mode;
int num_lines;
string RandomString(const int len);
};
}
}
#endif /* INPUT_READERS_BENCHMARK_H */