Skip to content

Commit

Permalink
mxq_group: Query stats_{wait,run,idle}_sec
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Aug 18, 2015
1 parent 7d29a69 commit d79ffbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mxq_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "mx_util.h"
#include "mx_mysql.h"

#define GROUP_FIELDS_CNT 26
#define GROUP_FIELDS_CNT 29
#define GROUP_FIELDS \
" group_id," \
" group_name," \
Expand All @@ -39,7 +39,11 @@
" stats_max_maxrss," \
" stats_max_utime_sec," \
" stats_max_stime_sec," \
" stats_max_real_sec"
" stats_max_real_sec," \
" stats_wait_sec," \
" stats_run_sec," \
" stats_idle_sec"


static int bind_result_group_fields(struct mx_mysql_bind *result, struct mxq_group *g)
{
Expand Down Expand Up @@ -83,6 +87,10 @@ static int bind_result_group_fields(struct mx_mysql_bind *result, struct mxq_gro
res += mx_mysql_bind_var(result, idx++, int64, &(g->stats_max_stime.tv_sec));
res += mx_mysql_bind_var(result, idx++, int64, &(g->stats_max_real.tv_sec));

res += mx_mysql_bind_var(result, idx++, uint64, &(g->stats_wait_sec));
res += mx_mysql_bind_var(result, idx++, uint64, &(g->stats_run_sec));
res += mx_mysql_bind_var(result, idx++, uint64, &(g->stats_idle_sec));

return res;
}

Expand Down
4 changes: 4 additions & 0 deletions mxq_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ struct mxq_group {
struct timeval stats_max_utime;
struct timeval stats_max_stime;
struct timeval stats_max_real;

uint64_t stats_wait_sec;
uint64_t stats_run_sec;
uint64_t stats_idle_sec;
};

#define MXQ_GROUP_STATUS_OK 0
Expand Down

0 comments on commit d79ffbe

Please sign in to comment.