-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branches 'Erbenos-fix(statsd)/keep-correct-track-of-pmns-mapped…
…-metric-count', 'pmdalinux-div-by-zero' and 'pmie-config-permissions'
- Loading branch information
Showing
4 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8877,8 +8877,10 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom) | |
break; | ||
case 8: /* filesys.full */ | ||
used = (__uint64_t)(sbuf->f_blocks - sbuf->f_bfree); | ||
ull = used + (__uint64_t)sbuf->f_bavail; | ||
atom->d = (100.0 * (double)used) / (double)ull; | ||
if ((ull = used + (__uint64_t)sbuf->f_bavail) == 0) | ||
atom->d = 0; /* protect against divide-by-zero */ | ||
else | ||
atom->d = (100.0 * (double)used) / (double)ull; | ||
break; | ||
case 9: /* filesys.blocksize -- added by Mike Mason <[email protected]> */ | ||
atom->ul = sbuf->f_bsize; | ||
|
@@ -8949,8 +8951,10 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom) | |
break; | ||
case 7: /* tmpfs.full */ | ||
used = (__uint64_t)(sbuf->f_blocks - sbuf->f_bfree); | ||
ull = used + (__uint64_t)sbuf->f_bavail; | ||
atom->d = (100.0 * (double)used) / (double)ull; | ||
if ((ull = used + (__uint64_t)sbuf->f_bavail) == 0) | ||
atom->d = 0; /* protect against divide-by-zero */ | ||
else | ||
atom->d = (100.0 * (double)used) / (double)ull; | ||
break; | ||
default: | ||
return PM_ERR_PMID; | ||
|
@@ -10659,6 +10663,8 @@ linux_init(pmdaInterface *dp) | |
hz = atoi(envpath); | ||
} else | ||
hz = sysconf(_SC_CLK_TCK); | ||
if (hz == 0) /* protect against divide-by-zero */ | ||
hz = 1; | ||
if ((envpath = getenv("LINUX_NCPUS")) != NULL) { | ||
/* | ||
* If $LINUX_NCPUS is set, this is a QA setting that | ||
|