Commit d241ada1 authored by lu43jih's avatar lu43jih
Browse files

Working on Gpfsmon plugin

parent 12cbba8c
......@@ -16,16 +16,32 @@
* No lambda used since the same function is needed in more than one place...
*/
struct SensorCompare {
bool operator()(const Gpfs_SB& left, const Gpfs_SB & rhs) const;
bool operator()(const Gpfs_SB& lhs, const Gpfs_SB & rhs) const {
return (lhs->getNodeName() < rhs->getNodeName()) || ( lhs->getNodeName() == rhs->getNodeName() && lhs->getMetricType() < rhs->getMetricType());
}
};
bool SensorCompare::operator()(const Gpfs_SB& lhs, const Gpfs_SB & rhs) const {
return lhs->getNodeName() < rhs->getNodeName() && lhs->getMetricType() < rhs->getMetricType();
}
GpfsmonSensorGroup::GpfsmonSensorGroup(const std::string& name) :
SensorGroupTemplate(name) {
createTempFile();
makeDummy();
}
GpfsmonSensorGroup& GpfsmonSensorGroup::operator=(const GpfsmonSensorGroup& other){
SensorGroupTemplate<GpfsmonSensorBase>::operator=(other);
data = other.data; //copy of vectors
makeDummy(); //no need to copy the state of dummy
return *this;
}
GpfsmonSensorGroup::GpfsmonSensorGroup(const GpfsmonSensorGroup& other):
SensorGroupTemplate<GpfsmonSensorBase>(other){
data = other.data;
makeDummy();
}
void GpfsmonSensorGroup::makeDummy(){
searchDummy = std::make_shared<GpfsmonSensorBase>("Dummy");
}
......@@ -157,9 +173,3 @@ void GpfsmonSensorGroup::createTempFile(){
}
}
GpfsmonSensorGroup& GpfsmonSensorGroup::operator=(const GpfsmonSensorGroup& other){
SensorGroupTemplate<GpfsmonSensorBase>::operator=(other);
data = other.data; //copy of vectors
searchDummy = std::make_shared<GpfsmonSensorBase>("Dummy"); //new pointer instead of shared...
return *this;
}
......@@ -24,12 +24,14 @@ public:
void stop() override;
GpfsmonSensorGroup& operator=(const GpfsmonSensorGroup& other);
GpfsmonSensorGroup(const GpfsmonSensorGroup& other);
private:
void read() override;
void readAsync() override;
void createTempFile();
void makeDummy();
const std::string cmd_io = "/usr/lpp/mmfs/bin/mmpmon -p -i /tmp/gpfsmon"; //todo change to real command
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment