Use redis for history on Heroku #330

Closed
wants to merge 3 commits into
from

Projects

None yet

5 participants

@bitle
bitle commented Mar 9, 2014

Enable redis to persist history on Heroku.

@ghost
ghost commented Apr 2, 2014

Does this also work for graph-widgets? I used this tutorial (which seems pretty much the same) and it did not persist graph-data. Can you confirm that?
Do you know if there is a way to do this (load historic graph-data (more than one value).

Chris

@bitle
bitle commented Apr 3, 2014

I copied my code from that tutorial. You can try this code:
set :history, Redis::HashKey.new('dashing-history', :marshal => true)
if you want to experiment. Source: https://github.com/nateware/redis-objects#values

@mr-deamon
Contributor

Yes, now it is writing multiple values, but still, if i restart dashing it deletes them and starts from scratch. Do you do some history-readings in you job in order to send full history after a restart?

Thanks
Chris

@tylermauthe
Contributor

This PR seems to try to load history from Redis but I don't see where it is saving the history to Redis.

You'll probably want to add some code to do this around in this block:
https://github.com/Shopify/dashing/blob/937fcce2dcca8010dbe8e9e26df954cb1330c1e0/lib/dashing/app.rb#L56-L58

@pushmatrix
Member

I'd rather not add a dependency on redis gems. I'd prefer if this functionality could be added as a separate gem. Something like dashing-redis. I should look into a nice extendable way of creating these for dashing. I can imagine people wanting to use different data stores.

@pushmatrix pushmatrix closed this Jun 8, 2015
@and7ey
and7ey commented Feb 28, 2016

Will appreciate if somebody would publish a wiki article with step-by-step tutorial how to enable redis usage (I did something, but not sure if it works correctly... first time use Ruby app). Believe, it will help other users too.

@and7ey
and7ey commented Mar 4, 2016

The code given in the commit doesn't work well when both history.yml exists and Redis supported:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:334:in `path2class': undefined class/module Redis:: (ArgumentError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment