coffeescript-rrd icon indicating copy to clipboard operation
coffeescript-rrd copied to clipboard

Tidy up output slightly

Open msiebuhr opened this issue 13 years ago • 0 comments

The current output format seem overly verbose:

[ { fieldNames: [ 'test-ds', 'test-two' ],
    timestamp: '1317132300',
    'test-ds': '-nan',
    'test-two': '-nan' },
  { fieldNames: [ 'test-ds', 'test-two' ],
    timestamp: '1317133200',
    'test-ds': '-nan',
    'test-two': '-nan' } ]

Technically, the fieldNames is redundant, as they can be deducted from the actual data names:

[ { timestamp: '1317132300',
    'test-ds': '-nan',
    'test-two': '-nan' },
  { timestamp: '1317133200',
    'test-ds': '-nan',
    'test-two': '-nan' } ]

Otherwise, they could be added in a header (possibly along with other helpful meta-data):

{ fieldNames: ['test-ds', 'test-two']
  firstTimestamp: '1317132300',
  lastTimestamp: '1317133200',
  data: {
    // The usual data.
  }
}

msiebuhr avatar Sep 27 '11 14:09 msiebuhr