Commit 21778ed2 authored by Swann Perarnau's avatar Swann Perarnau

[refactor] use the new downstream API

Match the changes made to the downstream API on the NRM side.
parent 0ad903f4
......@@ -28,7 +28,8 @@ int nrm_init(struct nrm_context *ctxt, const char *uuid)
assert(ctxt->container_uuid != NULL);
ctxt->app_uuid = (char *)uuid;
ctxt->context = zmq_ctx_new();
ctxt->socket = zmq_socket(ctxt->context, ZMQ_PUB);
ctxt->socket = zmq_socket(ctxt->context, ZMQ_DEALER);
zmq_setsockopt(ctxt->socket, ZMQ_IDENTITY, ctxt->app_uuid);
int err = zmq_connect(ctxt->socket, uri);
assert(err == 0);
char buf[512];
......@@ -28,13 +28,13 @@ struct nrm_context {
unsigned long acc;
#define NRM_DEFAULT_URI "ipc:///tmp/nrm-downstream-in"
#define NRM_DEFAULT_URI "ipc:///tmp/nrm-downstream-event"
#define NRM_START_FORMAT "{\"type\":\"application\", \"event\":\"start\", \"container\": \"%s\", \"uuid\": \"%s\", \"progress\": true, \"threads\": null}"
#define NRM_PROGRESS_FORMAT "{\"type\":\"application\", \"event\":\"progress\", \"payload\": \"%lu\", \"uuid\": \"%s\"}"
#define NRM_START_FORMAT "{\"api\":\"down_event\", \"type\":\"application_start\", \"container_uuid\": \"%s\", \"application_uuid\": \"%s\"}"
#define NRM_PROGRESS_FORMAT "{\"api\":\"down_event\", \"type\":\"progress\", \"payload\": \"%lu\"}"
#define NRM_PHASE_CONTEXT_FORMAT "{\"type\":\"application\", \"event\":\"phase_context\", \"cpu\": \"%u\", \"aggregation\": \"%u\", \"computetime\": \"%llu\", \"totaltime\": \"%llu\", \"uuid\": \"%s\"}"
#define NRM_EXIT_FORMAT "{\"type\":\"application\", \"event\":\"exit\", \"uuid\": \"%s\"}"
#define NRM_EXIT_FORMAT "{\"api\": \"down_event\", \"type\":\"application_exit\"}"
int nrm_init(struct nrm_context *, const char *);
int nrm_fini(struct nrm_context *);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment