Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions db/comdb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ long n_bad_swapin;
long n_retries;
long n_missed;
long n_dbinfo;
int64_t n_tagged_over_cdb2api = 0;

int n_commits;
long long n_commit_time; /* in micro seconds.*/
Expand Down
1 change: 1 addition & 0 deletions db/comdb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,7 @@ extern long n_bad_swapin;
extern long n_retries;
extern long n_missed;
extern long n_dbinfo;
extern int64_t n_tagged_over_cdb2api;
extern history *reqhist;
extern int gbl_sbuftimeout;
extern int sqldbgflag;
Expand Down
5 changes: 5 additions & 0 deletions db/db_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ struct comdb2_metrics_store {
int64_t fastsql_sslconn;
int64_t fastsql_execute_stop;
int64_t legacy_requests;
int64_t tagged_cdb2api;
};

static struct comdb2_metrics_store stats;
Expand Down Expand Up @@ -378,6 +379,9 @@ comdb2_metric gbl_metrics[] = {
&stats.legacy_requests, NULL},
{"max_current_connections", "Max current connections for sampled interval", STATISTIC_INTEGER,
STATISTIC_COLLECTION_TYPE_LATEST, &stats.max_current_connections, NULL},
{"tagged_over_cdb2api", "Number of tagged requests over cdb2api", STATISTIC_INTEGER,
STATISTIC_COLLECTION_TYPE_LATEST, &stats.tagged_cdb2api, NULL},

};

const char *metric_collection_type_string(comdb2_collection_type t) {
Expand Down Expand Up @@ -712,6 +716,7 @@ int refresh_metrics(void)

update_fastsql_metrics();
stats.max_current_connections = time_metric_max(thedb->connections);
stats.tagged_cdb2api = n_tagged_over_cdb2api;

return 0;
}
Expand Down
7 changes: 3 additions & 4 deletions plugins/newsql/newsql_evbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,6 @@ static int dispatch_tagged(struct sqlclntstate *clnt)
if (appdata->sqlquery == NULL || appdata->sqlquery->n_bindvars < 3 || appdata->sqlquery->bindvars[0] == NULL ||
appdata->sqlquery->bindvars[1] == NULL || appdata->sqlquery->bindvars[1]->value.len != sizeof(int) ||
appdata->sqlquery->bindvars[2] == NULL || appdata->sqlquery->bindvars[2]->value.len != sizeof(int)) {
// TODO
// write error response: HOW
// fprintf(stdout, ">> couldn't dispatch %d\n", __LINE__);
return 1;
}
int luxref;
Expand Down Expand Up @@ -700,7 +697,9 @@ static void process_query(struct newsql_appdata_evbuffer *appdata)
int have_sqlite_fmt = clnt->features.have_sqlite_fmt;
clnt->sqlite_row_format = have_sqlite_fmt;
clnt->is_tagged = sqlquery->has_is_tagged && sqlquery->is_tagged;
if (!clnt->is_tagged)
if (clnt->is_tagged)
++n_tagged_over_cdb2api;
else
++clnt->sqltick;

/* If the connection is forwarded from a secure pmux port,
Expand Down