Fix calculation of latencies (#294)

* Fix calculation of latencies

* linter fixes
This commit is contained in:
Georgy Rylov 2021-03-17 19:16:46 +05:00 committed by GitHub
parent e3ebd07c02
commit ee9eb583f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -42,9 +42,12 @@ int od_deploy(od_client_t *client, char *context)
return -1;
query_count++;
client->server->synced_settings = false;
od_debug(&instance->logger, context, client, server,
"deploy: %s", query);
} else {
client->server->synced_settings = true;
}
return query_count;

View File

@ -710,6 +710,13 @@ static od_frontend_status_t od_frontend_remote_server(od_relay_t *relay,
is_ready_for_query = 1;
od_backend_ready(server, data, size);
if (is_deploy)
server->deploy_sync--;
if (!server->synced_settings) {
server->synced_settings = true;
break;
}
/* update server stats */
int64_t query_time = 0;
od_stat_query_end(&route->stats, &server->stats_state,
@ -720,9 +727,6 @@ static od_frontend_status_t od_frontend_remote_server(od_relay_t *relay,
query_time);
}
if (is_deploy)
server->deploy_sync--;
break;
}
default:

View File

@ -42,6 +42,7 @@ struct od_server {
int offline;
uint64_t init_time_us;
od_list_t link;
bool synced_settings;
};
static inline void od_server_init(od_server_t *server)