I am using this module https://github.com/Lax/ngx_http_accounting_module for accounting nginx request count and byte out
I can see bytes_out is used in code and is working fine .
code snippet:
ngx_http_accounting_handler(ngx_http_request_t *r){
..
stats->bytes_out += r->connection->sent;
}
But how to calculate bytes_in? any clue? I checked ngx_http_request_s & ngx_connection_s which has ‘sent’ data but not the receive data. Any suggestion would be really helpful
Thanks
Use r->request_length, much like it’s done in nginx core for the $request_length log module variable.