GithubHelp home page GithubHelp logo

in rc2 version error: fluent-logger for nodejs (set milliseconds:1):report error:error="undefined method `nsec' for 1488276994397.0:Float\nDid you mean? inspect about fluent-plugin-influxdb HOT 10 CLOSED

linxuanwei avatar linxuanwei commented on September 27, 2024
in rc2 version error: fluent-logger for nodejs (set milliseconds:1):report error:error="undefined method `nsec' for 1488276994397.0:Float\nDid you mean? inspect

from fluent-plugin-influxdb.

Comments (10)

linxuanwei avatar linxuanwei commented on September 27, 2024

when i use:
var config = {
host: 'localhost',
port: 24224,
timeout: 3.0};

I works and no error .

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

@repeatedly

qq20170228-183727 2x

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

@repeatedly
qq20170228-184014 2x

`var winston = require('winston');
var config = {
//host: '10.9.20.79',
host: 'localhost',
port: 24224,
timeout: 3.0,
milliseconds: 1
};
var tag = 'test';
var fluentTransport = require('fluent-logger').support.winstonTransport();
var logger = new (winston.Logger)({
transports: [new fluentTransport(tag, config), new (winston.transports.Console)()]
});

logger.log('info', 'some_data');`

from fluent-plugin-influxdb.

repeatedly avatar repeatedly commented on September 27, 2024

fluentd doesn't support Float type time unit.
fluentd accepts only Integer second precision time or EventTime nano precision time.

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

I do nothing ,just use fluent-logger to send a log.

In fluent-logger source codes:
**` if (typeof time !== "number") {
time = Math.floor((time ? time.getTime() : Date.now()) / this._timeResolution);
}

 var packet = [tag, time, data];**`

fluent-logger use Integer not Float type.
why is Float error? where auto convert Integer type to Float in source codes?

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

`var winston = require('winston');
var config = {
//host: '10.9.20.79',
host: 'localhost',
port: 24224,
timeout: 3.0,
milliseconds: 1
};
var tag = 'test';
var fluentTransport = require('fluent-logger').support.winstonTransport();
var logger = new (winston.Logger)({
transports: [new fluentTransport(tag, config), new (winston.transports.Console)()]
});

logger.log('info', 'some_data');`

there are all my test codes .
fluend write 'some_data' to influxdb.
but report Float Type Error.

I really do nothing....
@repeatedly

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

If I remove 'milliseconds' option, all is ok.
@repeatedly

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

I use fluentd v0.14 and fluent-plugin-influxdb v 1.0.0.rc2

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

qq20170301-124454 2x
the 'time_precision' option does not work.

from fluent-plugin-influxdb.

linxuanwei avatar linxuanwei commented on September 27, 2024

@repeatedly

I fixed the bug in fluent-plugin-influxdb-1.0.0.rc2/lib/fluent/plugin/out_influxdb.rb

make "fluent-plugin-influxdb" support float

def precision_time(time) # nsec is supported from v0.14 if time.is_a?Float nstime = (time * (10 ** 9)).to_i else nstime = time * (10 ** 9) + (time.is_a?(Integer) ? 0 : time.nsec) end @time_precise.call(nstime) end

from fluent-plugin-influxdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.