Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Calling function getSample(), sample->max is smaller than sample->min #8

Open
yilongx opened this issue Aug 30, 2012 · 1 comment
Open
Labels

Comments

@yilongx
Copy link

yilongx commented Aug 30, 2012

I find sample->max is samller than sample->min when i call function getSample(); but not every time.

Testcode code as follows:

nmprk::translation::sample_t* sample;
try {
sample = nmprk::translation::getSample(&d,nmprk::translation::samplePower,nmprk::translation::domainSystem,NULL);
}catch(nmprk::nmprkException* e) {
std::cout << "Failed!\nCaught Exception getSample(power): Code[" << e->errorCode << "] MSG[" << e->errorMsg << "]\n";
return -1;
}
if(sample != NULL) {
std::cout << "Power Reading:\n";
std::cout << "\tCurrent Power Reading (Watts): " << sample->cur << std::endl;
std::cout << "\tMin Power Reading (Watts): " << sample->min << std::endl;
std::cout << "\tMax Power Reading (Watts): " << sample->max << std::endl;
std::cout << "\tAverage Power Reading (Watts): " << sample->avg << std::endl;
std::cout << "\tReading Time Stamp: " << asctime(&sample->timestamp) << std::endl;
std::cout << "\tReporting Period (seconds): " << sample->statReportingPeriod << std::endl;
}else{
std::cout << "Unable to sample power reading!\n";
return -1;
}

Print message as follows:

Power Reading:
Current Power Reading (Watts): 120
Min Power Reading (Watts): 87
Max Power Reading (Watts): 22
Average Power Reading (Watts): 112
Reading Time Stamp: Fri Aug 24 06:00:27 2012
Reporting Period (seconds): 80729

@ghost ghost assigned jrmassoni Aug 30, 2012
@jrmassoni
Copy link
Contributor

Will look for this issue, so far I have not seen it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants