Refer to sessions by ID instead of memory address
Using the unique ID for the session is easier to use than an address. This also allows the removal of all pointer values from the maxadmin output which is never useful to the end user.
This commit is contained in:
@ -2063,7 +2063,12 @@ dprintDCB(DCB *pdcb, DCB *dcb)
|
||||
dcb_printf(pdcb, "\tProtocol: %s\n",
|
||||
dcb->protoname);
|
||||
}
|
||||
dcb_printf(pdcb, "\tOwning Session: %p\n", dcb->session);
|
||||
|
||||
if (dcb->session && dcb->session->state != SESSION_STATE_DUMMY)
|
||||
{
|
||||
dcb_printf(pdcb, "\tOwning Session: %lu\n", dcb->session->ses_id);
|
||||
}
|
||||
|
||||
if (dcb->writeq)
|
||||
{
|
||||
dcb_printf(pdcb, "\tQueued write data: %d\n", gwbuf_length(dcb->writeq));
|
||||
|
||||
@ -1306,10 +1306,9 @@ printService(SERVICE *service)
|
||||
char time_buf[30];
|
||||
int i;
|
||||
|
||||
printf("Service %p\n", (void *)service);
|
||||
|
||||
printf("\tService: %s\n", service->name);
|
||||
printf("\tRouter: %s (%p)\n",
|
||||
service->routerModule, (void *)service->router);
|
||||
printf("\tRouter: %s\n", service->routerModule);
|
||||
printf("\tStarted: %s",
|
||||
asctime_r(localtime_r(&service->stats.started, &result), time_buf));
|
||||
printf("\tBackend databases\n");
|
||||
@ -1329,13 +1328,6 @@ printService(SERVICE *service)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
SERV_LISTENER *port = service->ports;
|
||||
while (port)
|
||||
{
|
||||
printf("\tUsers data: %p\n", (void *)port->users);
|
||||
port = port->next;
|
||||
}
|
||||
|
||||
printf("\tTotal connections: %d\n", service->stats.n_sessions);
|
||||
printf("\tCurrently connected: %d\n", service->stats.n_current);
|
||||
}
|
||||
@ -1395,11 +1387,8 @@ void dprintService(DCB *dcb, SERVICE *service)
|
||||
char timebuf[30];
|
||||
int i;
|
||||
|
||||
dcb_printf(dcb, "Service %p\n", service);
|
||||
dcb_printf(dcb, "\tService: %s\n",
|
||||
service->name);
|
||||
dcb_printf(dcb, "\tRouter: %s (%p)\n",
|
||||
service->routerModule, service->router);
|
||||
dcb_printf(dcb, "\tService: %s\n", service->name);
|
||||
dcb_printf(dcb, "\tRouter: %s\n", service->routerModule);
|
||||
switch (service->state)
|
||||
{
|
||||
case SERVICE_STATE_STARTED:
|
||||
@ -1450,13 +1439,6 @@ void dprintService(DCB *dcb, SERVICE *service)
|
||||
service->weightby);
|
||||
}
|
||||
|
||||
SERV_LISTENER *port = service->ports;
|
||||
while (port)
|
||||
{
|
||||
dcb_printf(dcb, "\tUsers data: %p\n", port->users);
|
||||
port = port->next;
|
||||
}
|
||||
|
||||
dcb_printf(dcb, "\tTotal connections: %d\n",
|
||||
service->stats.n_sessions);
|
||||
dcb_printf(dcb, "\tCurrently connected: %d\n",
|
||||
|
||||
@ -506,10 +506,9 @@ dprintSession(DCB *dcb, SESSION *print_session)
|
||||
char buf[30];
|
||||
int i;
|
||||
|
||||
dcb_printf(dcb, "Session %lu (%p)\n", print_session->ses_id, print_session);
|
||||
dcb_printf(dcb, "Session %lu\n", print_session->ses_id);
|
||||
dcb_printf(dcb, "\tState: %s\n", session_state(print_session->state));
|
||||
dcb_printf(dcb, "\tService: %s (%p)\n", print_session->service->name, print_session->service);
|
||||
dcb_printf(dcb, "\tClient DCB: %p\n", print_session->client_dcb);
|
||||
dcb_printf(dcb, "\tService: %s\n", print_session->service->name);
|
||||
|
||||
if (print_session->client_dcb && print_session->client_dcb->remote)
|
||||
{
|
||||
@ -547,7 +546,7 @@ bool dListSessions_cb(DCB *dcb, void *data)
|
||||
{
|
||||
DCB *out_dcb = (DCB*)data;
|
||||
SESSION *session = dcb->session;
|
||||
dcb_printf(out_dcb, "%-16p | %-15s | %-14s | %s\n", session,
|
||||
dcb_printf(out_dcb, "%-16lu | %-15s | %-14s | %s\n", session->ses_id,
|
||||
session->client_dcb && session->client_dcb->remote ?
|
||||
session->client_dcb->remote : "",
|
||||
session->service && session->service->name ?
|
||||
|
||||
Reference in New Issue
Block a user