@shop.collections.paginate(params[:page]) respond_with(@collections) end end def cache_key_data { shop_id: @shop.id, path: request.path, format: request.format, params: params.slice(:page), shop_version: @shop.version } end end
@shop.collections.paginate(params[:page]) respond_with(@collections) end end def cache_key_data { shop_id: @shop_id, path: request.path, format: request.format, params: params.slice(:page), shop_version: @shop.version } end end
:embed => true end # Fetch the product by its id, the primary index. @product = Product.fetch(id) # Fetch the images for the Product. # Images are embedded so the fetch would have already loaded them. @images = @product.fetch_images
true cache_index :vendor, :product_type end # Fetch the product from the cache by the index. # If the object isn't in the cache it is pulled from the db and stored in the cache. product = Product.fetch_by_handle(handle) products = Product.fetch_by_vendor_and_product_type(vendor, type)
StatsD.measure(‘Stripe.ExternalCall’, 2.5) # or more commonly pass a block that calls your code StatsD.measure(‘Stripe.ExternalCall') do Stripe.charge(order) end
specify how much to increment the key by StatsD.increment('FailedPayment', 10) # you can also specify a sample rate, so only 1/10 of events # actually get to statsd. Useful for very high volume data StatsD.increment(‘FailedPayment', 1, sample_rate: 0.1)
infrastructure 3. Élaborer des scénarios de défaillance 4. Pour chaque scénario, poser une ou plusieurs hypothèses 5. Effectuer une sauvegarde des données 6. Induire la défaillance dans le système