Source
xxxxxxxxxx
vmstat->disk_bps = 512 * ((diskstats.wblks - last_wblks) + (diskstats.rblks - last_rblks)) / (now - last_clock);
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/* defined in IBM AIX 7.1 libperfstat.h, not defined in AIX 6.1 */
/* Example of XINTFRAC = 125.000000 / 64.000000 = 1.953125. Apparently XINTFRAC is a period (in nanoseconds) */
/* of CPU ticks on a machine. For example, 1.953125 could mean there is 1.953125 nanoseconds between ticks */
/* and number of ticks in second is 1.0 / (1.953125 * 10^-9) = 512000000. So, tick frequency is 512 MHz. */
static int last_clock = 0;
/* --- kthr --- */
static zbx_uint64_t last_runque = 0; /* length of the run queue (processes ready) */
static zbx_uint64_t last_swpque = 0; /* length of the swap queue (processes waiting to be paged in) */
/* --- page --- */
static zbx_uint64_t last_pgins = 0; /* number of pages paged in */
static zbx_uint64_t last_pgouts = 0; /* number of pages paged out */
static zbx_uint64_t last_pgspins = 0; /* number of page ins from paging space */
static zbx_uint64_t last_pgspouts = 0; /* number of page outs from paging space */
static zbx_uint64_t last_cycles = 0; /* number of page replacement cycles */
static zbx_uint64_t last_scans = 0; /* number of page scans by clock */
/* -- faults -- */
static zbx_uint64_t last_devintrs = 0; /* number of device interrupts */
static zbx_uint64_t last_syscall = 0; /* number of system calls executed */
static zbx_uint64_t last_pswitch = 0; /* number of process switches (change in currently running */
/* process) */
/* --- cpu ---- */
/* Raw numbers of ticks are readings from forward-ticking counters. */
/* Only difference between 2 readings is meaningful. */
static zbx_uint64_t last_puser = 0; /* raw number of physical processor ticks in user mode */
static zbx_uint64_t last_psys = 0; /* raw number of physical processor ticks in system mode */
static zbx_uint64_t last_pidle = 0; /* raw number of physical processor ticks idle */
static zbx_uint64_t last_pwait = 0; /* raw number of physical processor ticks waiting for I/O */
static zbx_uint64_t last_user = 0; /* raw total number of clock ticks spent in user mode */
static zbx_uint64_t last_sys = 0; /* raw total number of clock ticks spent in system mode */
static zbx_uint64_t last_idle = 0; /* raw total number of clock ticks spent idle */
static zbx_uint64_t last_wait = 0; /* raw total number of clock ticks spent waiting for I/O */
static zbx_uint64_t last_timebase_last = 0; /* most recent processor time base timestamp */
static zbx_uint64_t last_pool_idle_time = 0; /* number of clock ticks a processor in the shared pool was */
/* idle */