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

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

@yilongx

Description

@yilongx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions