Implement converter-stream point -> lineProtocol
parent
d1cf1d8f7d
commit
f596a99ee6
@ -0,0 +1,22 @@
|
||||
const logger = require.main.require("./helper/logger.js")("InfluxPointToLineProtoStream");
|
||||
const { Transform } = require("stream");
|
||||
|
||||
/**
|
||||
* Get points and converts them to Line-protocol
|
||||
*/
|
||||
class InfluxPointToLineProtoStream extends Transform{
|
||||
constructor(){
|
||||
super({
|
||||
writableObjectMode: true
|
||||
});
|
||||
}
|
||||
|
||||
_transform(point, encoding, next){
|
||||
next(null, point.toLineProtocol() +"\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Specify exports
|
||||
module.exports = {
|
||||
InfluxPointToLineProtoStream
|
||||
};
|
Loading…
Reference in New Issue