GpfsmonSensorGroup.h 1.14 KB
Newer Older
lu43jih's avatar
lu43jih committed
1
/*
lu43jih's avatar
lu43jih committed
2
 * GpfsmonSensorGroup.h
lu43jih's avatar
lu43jih committed
3
4
 *
 *  Created on: 26.11.2018
lu43jih's avatar
lu43jih committed
5
 *      Author: Carla Guillen
lu43jih's avatar
lu43jih committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 */

#ifndef GPFSMON_GPFSMONSENSORGROUP_H_
#define GPFSMON_GPFSMONSENSORGROUP_H_

#include "../../includes/SensorGroupTemplate.h"

#include "GpfsmonSensorBase.h"

using Gpfs_SB = std::shared_ptr<GpfsmonSensorBase>;

class GpfsmonSensorGroup : public SensorGroupTemplate<GpfsmonSensorBase> {
public:
	GpfsmonSensorGroup(const std::string& name);
	virtual ~GpfsmonSensorGroup();

	void init(boost::asio::io_service& io) override;
	void start() override;
	void stop() override;

lu43jih's avatar
lu43jih committed
26
	GpfsmonSensorGroup& operator=(const GpfsmonSensorGroup& other);
lu43jih's avatar
lu43jih committed
27
	GpfsmonSensorGroup(const GpfsmonSensorGroup& other);
lu43jih's avatar
lu43jih committed
28

lu43jih's avatar
lu43jih committed
29
30
31
32
33
private:
	void read() override;
	void readAsync() override;

	void createTempFile();
34
	bool parseLine(std::string &&toparse);
lu43jih's avatar
lu43jih committed
35

lu43jih's avatar
lu43jih committed
36
	const std::string _cmd_io = "/usr/lpp/mmfs/bin/mmpmon -p -i /tmp/gpfsmon"; //todo change to real command
lu43jih's avatar
lu43jih committed
37

38
	std::vector<uint64_t> _data; //!< temp variable in parseLine defined here for efficiency.
lu43jih's avatar
lu43jih committed
39
	constexpr static int BUFFER_SIZE=255; //!< constant buffer that is used to parse line by line (from popen)
lu43jih's avatar
lu43jih committed
40
41
42
43
44
};



#endif /* GPFSMON_GPFSMONSENSORGROUP_H_ */