Skip to content
Ric Lister edited this page May 24, 2013 · 1 revision

The test source generates fake time-series data for fun and profit. Can also be used to generate sparse test events.

Metric options

  • type: test
  • target: a fake name for the metric; can append &sparsity=0.5 to specify the sparsity of the data as a ratio

Example

Dash.stats()
  .add({
    title:  'Fake data',
    type:   'test',
    target: 'foo.bar.baz&sparsity=0.2'
  })

Find

The .find() method returns the number of fake metric names requested in the target param.

Dash.stats()
  .config({
    type:    'test',
    display: 'last'
  })
  .find({
    type:   'test',             // fake data
    target: '3',                // number of metrics to return
    add: function(metric) {
      return {
        title:  Dash.capitalize(metric.replace(/\./g, ' ')),
        target: metric + '&sparsity=' + Math.random()
      }
    }
  })

Events

Use a very high sparsity to generate realistic events:

Dash.events()
  .add(
    {
      title:  'FakeEvent',
      type:   'test',
      target: 'test.event&sparsity=0.98'
    }
  )
Clone this wiki locally