Skip to content

Commit

Permalink
imap: Set command start timestamps earlier.
Browse files Browse the repository at this point in the history
Previously timing statistics in taglines weren't shown commands that didn't
read any parameters.

Also the timings now include the time speng reading command parameters from
client. For example:

a list "" {1}
+ OK
%
* LIST (\HasNoChildren) "/" INBOX
a OK List completed (0.001 + 1.214 secs).
  • Loading branch information
sirainen committed May 13, 2016
1 parent 31fc5ca commit 47d4398
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/imap/imap-client.c
Expand Up @@ -584,9 +584,6 @@ bool client_read_args(struct client_command_context *cmd, unsigned int count,
str = t_str_new(256);
imap_write_args(str, *args_r);
cmd->args = p_strdup(cmd->pool, str_c(str));
cmd->start_time = ioloop_timeval;
cmd->start_ioloop_wait_usecs =
io_loop_get_wait_usecs(current_ioloop);

cmd->client->input_lock = NULL;
return TRUE;
Expand Down Expand Up @@ -723,6 +720,8 @@ struct client_command_context *client_command_alloc(struct client *client)
cmd = p_new(client->command_pool, struct client_command_context, 1);
cmd->client = client;
cmd->pool = client->command_pool;
cmd->start_time = ioloop_timeval;
cmd->start_ioloop_wait_usecs = io_loop_get_wait_usecs(current_ioloop);
p_array_init(&cmd->module_contexts, cmd->pool, 5);

DLLIST_PREPEND(&client->command_queue, cmd);
Expand Down

0 comments on commit 47d4398

Please sign in to comment.