Browse Source

Remove use of send_recv_proc internally from ckpool.c

master
Con Kolivas 8 years ago
parent
commit
1688b4f5d7
  1. 4
      src/ckpool.c
  2. 3
      src/connector.c
  3. 1
      src/connector.h
  4. 3
      src/stratifier.c
  5. 1
      src/stratifier.h

4
src/ckpool.c

@ -476,12 +476,12 @@ retry:
} }
} else if (cmdmatch(buf, "stratifierstats")) { } else if (cmdmatch(buf, "stratifierstats")) {
LOGDEBUG("Listener received stratifierstats request"); LOGDEBUG("Listener received stratifierstats request");
msg = send_recv_proc(ckp->stratifier, "stats"); msg = stratifier_stats(ckp, ckp->sdata);
send_unix_msg(sockd, msg); send_unix_msg(sockd, msg);
dealloc(msg); dealloc(msg);
} else if (cmdmatch(buf, "connectorstats")) { } else if (cmdmatch(buf, "connectorstats")) {
LOGDEBUG("Listener received connectorstats request"); LOGDEBUG("Listener received connectorstats request");
msg = send_recv_proc(ckp->connector, "stats"); msg = connector_stats(ckp->cdata, 0);
send_unix_msg(sockd, msg); send_unix_msg(sockd, msg);
dealloc(msg); dealloc(msg);
} else if (cmdmatch(buf, "ckdbflush")) { } else if (cmdmatch(buf, "ckdbflush")) {

3
src/connector.c

@ -1293,11 +1293,12 @@ static void drop_passthrough_client(cdata_t *cdata, const int64_t id)
send_client(cdata, id, msg); send_client(cdata, id, msg);
} }
static char *connector_stats(cdata_t *cdata, const int runtime) char *connector_stats(void *data, const int runtime)
{ {
json_t *val = json_object(), *subval; json_t *val = json_object(), *subval;
client_instance_t *client; client_instance_t *client;
int objects, generated; int objects, generated;
cdata_t *cdata = data;
sender_send_t *send; sender_send_t *send;
int64_t memsize; int64_t memsize;
char *buf; char *buf;

1
src/connector.h

@ -12,6 +12,7 @@
void connector_upstream_msg(ckpool_t *ckp, char *msg); void connector_upstream_msg(ckpool_t *ckp, char *msg);
void connector_add_message(ckpool_t *ckp, json_t *val); void connector_add_message(ckpool_t *ckp, json_t *val);
char *connector_stats(void *data, const int runtime);
void *connector(void *arg); void *connector(void *arg);
#endif /* CONNECTOR_H */ #endif /* CONNECTOR_H */

3
src/stratifier.c

@ -3570,10 +3570,11 @@ static void ckmsgq_stats(ckmsgq_t *ckmsgq, const int size, json_t **val)
JSON_CPACK(*val, "{si,si,si}", "count", objects, "memory", memsize, "generated", generated); JSON_CPACK(*val, "{si,si,si}", "count", objects, "memory", memsize, "generated", generated);
} }
static char *stratifier_stats(ckpool_t *ckp, sdata_t *sdata) char *stratifier_stats(ckpool_t *ckp, void *data)
{ {
json_t *val = json_object(), *subval; json_t *val = json_object(), *subval;
int objects, generated; int objects, generated;
sdata_t *sdata = data;
int64_t memsize; int64_t memsize;
char *buf; char *buf;

1
src/stratifier.h

@ -13,6 +13,7 @@
void parse_remote_txns(ckpool_t *ckp, const json_t *val); void parse_remote_txns(ckpool_t *ckp, const json_t *val);
#define parse_upstream_txns(ckp, val) parse_remote_txns(ckp, val) #define parse_upstream_txns(ckp, val) parse_remote_txns(ckp, val)
void parse_upstream_auth(ckpool_t *ckp, json_t *val); void parse_upstream_auth(ckpool_t *ckp, json_t *val);
char *stratifier_stats(ckpool_t *ckp, void *data);
void stratifier_add_recv(ckpool_t *ckp, json_t *val); void stratifier_add_recv(ckpool_t *ckp, json_t *val);
void *stratifier(void *arg); void *stratifier(void *arg);

Loading…
Cancel
Save