'\" t -*- coding: UTF-8 -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH sg_get_load_stats 3 2019-03-08 libstatgrab "" .SH NAME sg_get_load_stats, sg_get_load_stats_r, sg_free_load_stats \- get system load .SH SYNOPSIS 'nh .nf \*(T<#include \*(T> .fi .sp 1 .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(size_t *\fIentries\fR);\*(T> 'in \n(.iu-\nxu .ad b .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(size_t *\fIentries\fR);\*(T> 'in \n(.iu-\nxu .ad b .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(sg_load_stats *\fIdata\fR);\*(T> 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION These calls returns a pointer to a buffer containing information about cumulated machine load. .PP \fBAPI Shortcut\fR .TS allbox ; l | l | l. T{ function T} T{ returns T} T{ data owner T} .T& l | l | l l | l | l. T{ sg_get_load_stats T} T{ \*(T * T} T{ libstatgrab (thread local) T} T{ sg_get_load_stats_r T} T{ \*(T * T} T{ caller T} .TE .PP The \*(T buffer received from \*(T<\fBsg_get_load_stats_r\fR\*(T>() must be freed using \*(T<\fBsg_free_load_stats\fR\*(T>() when not needed any more. The caller is responsible for doing it. .PP On most systems this function is just a wrapper to the \*(T<\fBgetloadavg\fR\*(T> system call. .SH "RETURN VALUES" The structure returned is of type \*(T. .PP .nf \*(T< typedef struct{ double min1; double min5; double min15; time_t systime; }sg_load_stats; \*(T> .fi .TP \*(T The load average over 1 minute. .TP \*(T The load average over 5 minutes. .TP \*(T The load average over 15 minutes. .TP \*(T The timestamp when the above stats where collected in seconds since epoch .SH "SEE ALSO" \fBstatgrab\fR(3) .SH WEBSITE \(lahttps://libstatgrab.org/\(ra