question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Odd parameter scheme for writePoints(), vs. the docs?

See original GitHub issue

IMO the way parameters are passed to writePoints is a little odd, each point being an array of two objects, with the timestamp being a special field in the first object. This goes against the order specified in the Line Protocol docs, measurement,tag1=value1,tag2=value2 field1=value1,field2=value2 timestamp.

How about an alternative API, where a point can be an object instead of a 2-element array, with a key fields, and optional keys time and tags?

writePoints(measurementName, [
  {
    fields: {value: 123, otherValue: 456},
    tags: {foo: 'bar'},
    time: new Date()
  },
  {
    fields: {foo: 123}  // no tags or timestamp
  },
  {
    fields: 123  // automatically converted to value=123
  },
  [{a: 1}, {b: 2}],  // old school - unclear which is the field and which is the tag
], [options], callback)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
andydaycommented, Oct 6, 2016

seriesName !== measureName.

The name series is used in several places where the name measure should be used. For instance writeSeries with its current usage is misleading. A series is a unique combo of retention, measure, and tags. The way the writeSeries is used is more a write multiple points for multiple measures. It might be better to merge writeSeries and writePoints with the following usage:

writePoints([{
    measure: 'mymeasurename',
    fields: {
        field1: 123,
        field2: 234
    },
    tags: {
        tag1: 'mytag'
    },
    time:  Date.now()
}], ...)

To be clear there is no such thing as a series name only measure name.

0reactions
connor4312commented, Oct 7, 2016

With completion of the write API in https://github.com/node-influx/node-influx/commit/0ef0889605cab3d323ff0b4cf4992757a60472d8 I’m closing this issue. Please feel free to take a read over the docs (and/or code) here and let me know if you’ve suggestions for improvement: index.ts#L540

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I write a point value as an integer? #190 - GitHub
Odd parameter scheme for writePoints(), vs. the docs? ... Please feel free to take a read over the docs (and/or code) here and...
Read more >
Functional Programming - Introduction to Scheme
Scheme is a dialect of Lisp, the second-oldest programming language that is still ... In order to call product() , 0 or more...
Read more >
UeiDaq Framework User Manual
This manual provides documentation for using the UeiDaq framework API. ... can then configure the session parameters and operate the session.
Read more >
Niagara IRM Function Blocks - Centraline
Input, Output and Parameter slots. The output slots are located at the top of the FB and the inputs at the bottom. This...
Read more >
OBIX Version 1.1 - OASIS Open
Companion documents will specify the protocol bindings and encodings for specific ... Typically, http scheme URIs are used, but other bindings may require ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found