Exemplo n.º 1
0
string json_writer::dump(const context &c)
  {
  using namespace detail;
  
  auto conf = c.get_config();
  string results(conf->allocator());

  append(results,
    "{\n"
    "  \"name\": \"", c.name(), "\",\n"
    "  \"machine_identity\": ");

  conf->get_identity().json_description(results, "  ");

  append(results, ",\n"
    "  \"start\": ", c.start_time(), ",\n"
    "  \"results\": [\n");


  bool started = false;
  for(const auto &e : c.events())
    {
    if (started)
      {
      results += ",\n";
      }
    started = true;

    dump(e, c, results, "    ");
    }

  append(results, "\n"
    "  ]\n"
    "}\n");
  return results;
  }
Exemplo n.º 2
0
 in_edge_manager::in_edge_manager( context& ctx  ) 
   :context_( ctx ),
    worker_type_( ctx.get_config()["worker-type"].as<string>() ),
    worker_id_( ctx.get_config()["worker-id"].as<int>() ) {
 }