MXS-1541: Use session ID in topfilter

The topfilter now uses the session ID as the filename suffix.
This commit is contained in:
Markus Mäkelä
2018-01-02 12:56:50 +02:00
parent d587f4b3ea
commit 9689271a34
3 changed files with 8 additions and 4 deletions

View File

@ -44,7 +44,7 @@ The top filter has one mandatory parameter, `filebase`, and a number of optional
### 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

View File

@ -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
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
## New Features

View File

@ -285,9 +285,8 @@ newSession(MXS_FILTER *instance, MXS_SESSION *session)
MXS_FREE(my_session);
return NULL;
}
sprintf(my_session->filename, "%s.%d", my_instance->filebase,
my_instance->sessions);
atomic_add(&my_instance->sessions, 1);
sprintf(my_session->filename, "%s.%lu", my_instance->filebase, session->ses_id);
my_session->top = (TOPNQ **) MXS_CALLOC(my_instance->topN + 1, sizeof(TOPNQ *));
MXS_ABORT_IF_NULL(my_session->top);
for (i = 0; i < my_instance->topN; i++)