Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Easily monitor your product data

Easily monitor your product data

Damien Mathieu

June 18, 2014
Tweet

More Decks by Damien Mathieu

Other Decks in Technology

Transcript

  1. Monitor all the things
    @dmathieu

    View Slide

  2. (Easily) Monitor all the things
    @dmathieu

    View Slide

  3. Awesome app

    View Slide

  4. Such features

    View Slide

  5. View Slide

  6. Product monitoring
    X new users this month.!
    X active users this month.!
    X users who left this month.!

    View Slide

  7. Let’s build a production
    monitoring dashboard

    View Slide

  8. module Api
    module V1
    class StatsController < ::Api::V1::BaseController
    respond_to :json
    !
    def index
    stats = StatService.search(current_user, params[:ids], params[:query])
    respond_with stats, root: :stats
    end
    !
    def show
    service = StatService.find(current_user, params[:id])
    respond_with service.subject
    end
    !
    def create
    service = StatService.new(Stat.new)
    service.save(permitted_params, current_user)
    !
    respond_with service.subject
    end
    !
    def update
    service = StatService.find(current_user, params[:id])
    service.save(permitted_params, current_user)
    !
    respond_with service.subject
    end
    !
    def destroy
    service = StatService.find(current_user, params[:id])
    service.destroy(current_user)
    !
    respond_with service.subject
    end
    !
    private
    def permitted_params
    params.require(:stat).permit(*StatService.permitted_params)
    end
    end
    end
    end

    View Slide

  9. Just kidding
    Remember the title of the talk?
    Easily Monitor all the things

    View Slide

  10. What’s the easiest way to
    view data?
    SELECT date_trunc('month', users.created_at) as date,
    count(*)
    FROM users
    GROUP BY date
    ORDER BY date DESC;

    View Slide

  11. Have you met data clips?
    https://dataclips.heroku.com
    https://github.com/mmcgrana/pgpin

    View Slide

  12. View Slide

  13. View Slide

  14. Are we done?
    Sure we’re not!
    What’s the way best to get an overall
    view of things?

    View Slide

  15. View Slide

  16. Postgres to Librato

    View Slide

  17. Postgres to Librato
    https://github.com/ys/libraclips
    https://github.com/mmcgrana/
    pg2librato

    View Slide

  18. View Slide

  19. I now declare thee
    king of your own data

    View Slide

  20. Thanks
    Questions?
    http://bit.ly/data-monitoring

    View Slide