MXS-1541: Use session ID in topfilter
The topfilter now uses the session ID as the filename suffix.
This commit is contained in:
@ -44,7 +44,7 @@ The top filter has one mandatory parameter, `filebase`, and a number of optional
|
|||||||
|
|
||||||
### Filebase
|
### Filebase
|
||||||
|
|
||||||
The basename of the output file created for each session. A session index is added to the filename for each file written. This is a mandatory parameter.
|
The basename of the output file created for each session. The session ID is added to the filename for each file written. This is a mandatory parameter.
|
||||||
|
|
||||||
```
|
```
|
||||||
filebase=/tmp/SqlQueryLog
|
filebase=/tmp/SqlQueryLog
|
||||||
|
@ -87,6 +87,11 @@ multi-statement or a compound statement modifies the state of the
|
|||||||
session. This is not a good practice and a change in the client side
|
session. This is not a good practice and a change in the client side
|
||||||
behavior is advised.
|
behavior is advised.
|
||||||
|
|
||||||
|
### Top Filter
|
||||||
|
|
||||||
|
The top filter now uses the session ID instead of an internal counter for the
|
||||||
|
names of the log file names.
|
||||||
|
|
||||||
## Dropped Features
|
## Dropped Features
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
|
@ -285,9 +285,8 @@ newSession(MXS_FILTER *instance, MXS_SESSION *session)
|
|||||||
MXS_FREE(my_session);
|
MXS_FREE(my_session);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
sprintf(my_session->filename, "%s.%d", my_instance->filebase,
|
sprintf(my_session->filename, "%s.%lu", my_instance->filebase, session->ses_id);
|
||||||
my_instance->sessions);
|
|
||||||
atomic_add(&my_instance->sessions, 1);
|
|
||||||
my_session->top = (TOPNQ **) MXS_CALLOC(my_instance->topN + 1, sizeof(TOPNQ *));
|
my_session->top = (TOPNQ **) MXS_CALLOC(my_instance->topN + 1, sizeof(TOPNQ *));
|
||||||
MXS_ABORT_IF_NULL(my_session->top);
|
MXS_ABORT_IF_NULL(my_session->top);
|
||||||
for (i = 0; i < my_instance->topN; i++)
|
for (i = 0; i < my_instance->topN; i++)
|
||||||
|
Reference in New Issue
Block a user