diff --git a/src/pcp/atop/various.c b/src/pcp/atop/various.c index 7949bc1..6da8a02 100644 --- a/src/pcp/atop/various.c +++ b/src/pcp/atop/various.c @@ -815,7 +815,19 @@ fetch_metrics(const char *purpose, int nmetrics, pmID *pmids, pmResult **result) { int sts; - pmSetMode(fetchmode, &curtime, fetchstep); + if ((fetchmode &__PM_MODE_MASK) != PM_MODE_LIVE && strcmp(purpose, "host") == 0) { + /* + * When reading from an archive, and fetching the host + * metrics, don't use interpolate mode and start at the + * beginning of the archive ... these metrics are only + * likely to be logged once and near the start of the + * archive. + */ + struct timeval epoch = { 0, 0 }; + pmSetMode(PM_MODE_FORW, &epoch, 0); + } + else + pmSetMode(fetchmode, &curtime, fetchstep); if ((sts = pmFetch(nmetrics, pmids, result)) < 0) { if (sts != PM_ERR_EOL)