jondot/graphene

refresh_interval is ignored

peterbourgon opened this issue · 5 comments

Title says it all. All my TimeSeries (at a minimum -- probably my GaugeLabels as well) are refreshing every 1s, no matter what I set their refresh_interval to. It's entirely possible I'm misusing the API, but I can't find a definitive example. Here's what I've got:

    "example-timeseries": {
      source: GRAPHITE_BASE + "target=my.special.thing&from=-24hour&until=now",
      TimeSeries: {
        refresh_interval: 1000000,
        parent: '#my-special-thing',
        width: 700,
        height: 450
      }
    },

Am I doing something wrong?

Hi Peter,
Initially, I haven't included refresh_interval as a property for the Graphene builder, the Graphene builder was made in order to keep things simple when composing the parts of a dashboard. This means, that if you needed refresh_interval or other low-level properties (there are more) you would have needed to connect the pieces instead of using the builder, such as:

    m = new Graphene.GraphiteModel(opts) // here, initialize `source` and `refresh_interval` as you wish
    v = new Graphene.TimeSeriesView(model: m, viewOpts)
    m.start() //to start polling

This is actually what the builder is doing here, but it uses a "sane" set of flags that are exposed via the builder:

    https://github.com/jondot/graphene/blob/master/app/js/graphene.coffee#L13

So this is the long answer :)

The short answer is that, since you expected it to be there, it means that it should have been there -- also -- thanks for this feedback!.
So I'll add refresh_interval to the builder. I'll push an update by tomorrow.

Hope this helps

I see! This explains why things weren't behaving as expected :)

Should be good now, hope this works for you!

I can confirm it works great. Sorry for the delay.

Awesome, I'd like to thank you for bringing this up!