Skip to content

Instantly share code, notes, and snippets.

[11a8bccd] Command: ( export RAILS_ENV="production" RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.5" ; /usr/bin/env ln -s /home/deploy/project/shared/tmp/sockets /home/deploy/project/releases/20200626083910/tmp/sockets )
INFO [11a8bccd] Finished in 0.715 seconds with exit status 0 (successful).
DEBUG [cc784c56] Running [ -L /home/deploy/project/releases/20200626083910/public/system ] as deploy@199.192.25.241
DEBUG [cc784c56] Command: [ -L /home/deploy/project/releases/20200626083910/public/system ]
DEBUG [cc784c56] Finished in 0.707 seconds with exit status 1 (failed).
DEBUG [5871da54] Running [ -d /home/deploy/project/releases/20200626083910/public/system ] as deploy@199.192.25.241
DEBUG [5871da54] Command: [ -d /home/deploy/project/releases/20200626083910/public/system ]
DEBUG [5871da54] Finished in 0.710 seconds with exit status 1 (failed).
INFO [21cd3160] Running /usr/bin/env ln -s /home/deploy/project/shared/public/system /home/deploy/project/releases/20200626083910/public/system as deploy@199.1
def custom_reverse(array)
array.each_with_object([]) { |i, result| result.unshift(i) }
end
# frozen_string_literal: true
class Response
attr_reader :sender, :receiver, :response
def initialize(sender, receiver, response)
@sender = sender
@receiver = receiver
@response = response
end
{
"har1": {
"url": "https://raw.githubusercontent.com/ruvaleev/rails-optimization-task5/valeev_dz5/HAR_before_optimization.har",
"label": "Before optimization",
"run": 1
},
"har2": {
"url": "https://raw.githubusercontent.com/ruvaleev/rails-optimization-task5/valeev_dz5/HAR_after_optimization.har",
"label": "After optimization",
"run": 2
class BenchmarkComparing
SIZE = 100_000
def run
Benchmark.ips do |x|
# The default is :stats => :sd, which doesn't have a configurable confidence
# confidence is 95% by default, so it can be omitted
x.config(:stats => :bootstrap, :confidence => 99)
x.report("case_export_service") { case_export_service('Application') }
@ruvaleev
ruvaleev / base_export.rb
Created February 27, 2020 06:55
Новый экспорт, чтоб память не раздувалась
require 'securerandom'
require 'fileutils'
##
# Родительский класс экспортов.
class BaseExport
attr_reader :objects, :export, :format, :file_name, :errors
EXPORT_DIRECTORY_NAME = 'export_files'.freeze
I, [2019-12-11T20:21:12.291764 #33850] INFO -- : Started GET "/" for 127.0.0.1 at 2019-12-11 20:21:12 +0700
/Users/ruslan/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651: [BUG] Segmentation fault at 0x0000000000000110
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-darwin19]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports