<commit_before>#include <sstream>
#include <map>
#include <cassert>
#include <eiger.h>

#include "datakind.h"
#include "eigerbackend.h"

EigerBackend::EigerBackend(std::string sitename, std::string machine, bool append)
  : sitename_(sitename), dc_(sitename, sitename), app_(sitename, sitename), machine_(machine, machine)
{
		dc_.commit();
    app_.commit();
    machine_.commit();
}

void EigerBackend::addCol(const std::string& label, const enum datakind kind){
  eiger::metric_type_t etype;
  std::string slabel = sitename_ + "_"+label;
  switch(kind){
    case RESULT:
      etype = eiger::RESULT;
      break;
    case DETERMINISTIC:
      etype = eiger::DETERMINISTIC;
			break;
    case NONDETERMINISTIC:
      etype = eiger::NONDETERMINISTIC;
			break;
		default:
			throw "eigerbackend: addCol unhandled datakind";<commit_msg>allow lwperf to be used with fakeeiger<commit_after>#include <sstream>
#include <map>
#include <cassert>
#ifdef _USE_FAKEEIGER 
#include <mpifakeeiger.h>
#else
#include <eiger.h>
#endif

#include "datakind.h"
#include "eigerbackend.h"

EigerBackend::EigerBackend(std::string sitename, std::string machine, bool append)
  : sitename_(sitename), dc_(sitename, sitename), app_(sitename, sitename), machine_(machine, machine)
{
		dc_.commit();
    app_.commit();
    machine_.commit();
}

void EigerBackend::addCol(const std::string& label, const enum datakind kind){
  eiger::metric_type_t etype;
  std::string slabel = sitename_ + "_"+label;
  switch(kind){
    case RESULT:
      etype = eiger::RESULT;
      break;
    case DETERMINISTIC:
      etype = eiger::DETERMINISTIC;
			break;
    case NONDETERMINISTIC:
      etype = eiger::NONDETERMINISTIC;
			break;
		default:
			throw "eigerbackend: addCol unhandled datakind";
{'fraction_non_alphanumeric': 0.12791358726549176, 'fraction_numerical': 0.0, 'mean_word_length': 4.770491803278689, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4970820', 'n_tokens_mistral': 647, 'n_tokens_neox': 624, 'n_words': 139}