MCPcopy Create free account
hub / github.com/MariaDB/server / add_diff_to_status

Function add_diff_to_status

sql/sql_class.cc:2039–2073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2037*/
2038
2039void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
2040 STATUS_VAR *dec_var)
2041{
2042 ulong *end= (ulong*) ((uchar*) to_var + offsetof(STATUS_VAR,
2043 last_system_status_var) +
2044 sizeof(ulong));
2045 ulong *to= (ulong*) to_var, *from= (ulong*) from_var, *dec= (ulong*) dec_var;
2046
2047 while (to != end)
2048 *(to++)+= *(from++) - *(dec++);
2049
2050 to_var->bytes_received+= from_var->bytes_received -
2051 dec_var->bytes_received;
2052 to_var->bytes_sent+= from_var->bytes_sent - dec_var->bytes_sent;
2053 to_var->rows_read+= from_var->rows_read - dec_var->rows_read;
2054 to_var->rows_sent+= from_var->rows_sent - dec_var->rows_sent;
2055 to_var->rows_tmp_read+= from_var->rows_tmp_read - dec_var->rows_tmp_read;
2056 to_var->binlog_bytes_written+= from_var->binlog_bytes_written -
2057 dec_var->binlog_bytes_written;
2058 to_var->cpu_time+= from_var->cpu_time - dec_var->cpu_time;
2059 to_var->busy_time+= from_var->busy_time - dec_var->busy_time;
2060 to_var->table_open_cache_hits+= from_var->table_open_cache_hits -
2061 dec_var->table_open_cache_hits;
2062 to_var->table_open_cache_misses+= from_var->table_open_cache_misses -
2063 dec_var->table_open_cache_misses;
2064 to_var->table_open_cache_overflows+= from_var->table_open_cache_overflows -
2065 dec_var->table_open_cache_overflows;
2066 to_var->query_time+= from_var->query_time - dec_var->query_time;
2067
2068 /*
2069 We don't need to accumulate memory_used as these are not reset or used by
2070 the calling functions. See execute_show_status().
2071 tmp_space_usage also does not need to be accumulated.
2072 */
2073}
2074
2075
2076/**

Callers 1

execute_show_statusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected