Created
January 31, 2014 18:21
-
-
Save mariash/8739151 to your computer and use it in GitHub Desktop.
rblineprof output when hitting /v2/apps?inline-relations-depth=1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Rack::Lineprof] ===============================================================[0m | |
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.7.1.180/lib/new_relic/agent/transaction.rb | |
[90m | 32 # Return the currently active transaction, or nil. | |
[0m[90m | 33 def self.current | |
[0m[37m 333.3ms 32234 | 34 self.stack.last | |
[0m[90m | 35 end | |
[0m[90m | 36 | |
[0m[90m .......[0m | |
[90m | 53 | |
[0m[90m | 54 def self.stack | |
[0m[37m 224.7ms 32250 | 55 TransactionState.get.current_transaction_stack | |
[0m[90m | 56 end | |
[0m[90m | 57 | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.7.1.180/lib/new_relic/agent/stats_engine/stats_hash.rb | |
[90m | 44 | |
[0m[90m | 45 def record(metric_specs, value=nil, aux=nil) | |
[0m[37m 203.9ms 3586 | 46 Array(metric_specs).each do |metric_spec| | |
[0m[90m | 47 stats = nil | |
[0m[90m | 48 begin | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.7.1.180/lib/new_relic/agent/stats_engine/transactions.rb | |
[90m | 102 | |
[0m[90m | 103 def transaction_stats_hash | |
[0m[37m 275.3ms 10742 | 104 Transaction.current && Transaction.current.stats_hash | |
[0m[90m | 105 end | |
[0m[90m | 106 | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/steno-1.2.2/lib/steno/logger.rb | |
[90m | 25 | |
[0m[90m | 26 def define_log_method(name) | |
[0m[37m 833.0ms 901 | 27 define_method(name) { |*args, &blk| log(name, *args, &blk) } | |
[0m[90m | 28 end | |
[0m[90m | 29 | |
[0m[90m .......[0m | |
[90m | 129 message = yield if block_given? | |
[0m[90m | 130 | |
[0m[37m 213.4ms 901 | 131 callstack = caller | |
[0m[90m | 132 loc = parse_record_loc(callstack) | |
[0m[90m | 133 | |
[0m[90m .......[0m | |
[90m | 136 record = Steno::Record.new(@name, level_name, message, loc, data) | |
[0m[90m | 137 | |
[0m[37m 458.0ms 3604 | 138 @sinks.each { |sink| sink.add_record(record) } | |
[0m[90m | 139 | |
[0m[90m | 140 nil | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/steno-1.2.2/lib/steno/codec/json.rb | |
[90m | 32 } | |
[0m[90m | 33 | |
[0m[37m 207.5ms 1802 | 34 Yajl::Encoder.encode(h) + "\n" | |
[0m[90m | 35 end | |
[0m[90m | 36 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/yajl-ruby-1.1.0/lib/yajl.rb | |
[90m | 70 end | |
[0m[90m | 71 end if args.any? | |
[0m[37m 243.9ms 46206 | 72 new(options).encode(obj, io, &block) | |
[0m[90m | 73 end | |
[0m[90m | 74 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/model/base.rb | |
[90m | 136 def call(values) | |
[0m[90m | 137 o = allocate | |
[0m[37m 462.7ms 2441 | 138 o.set_values(values) | |
[0m[90m | 139 o.after_initialize | |
[0m[90m | 140 o | |
[0m[90m .......[0m | |
[90m | 1054 # If the column isn't in @values, we can't assume it is | |
[0m[90m | 1055 # NULL in the database, so assume it has changed. | |
[0m[37m 200.8ms 2590 | 1056 v = typecast_value(column, value) | |
[0m[90m | 1057 vals = @values | |
[0m[90m | 1058 if new? || !vals.include?(column) || v != (c = vals[column]) || v.class != c.class | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/dataset/query.rb | |
[90m | 990 # # SELECT * FROM items WHERE b GROUP BY a HAVING a | |
[0m[90m | 991 def where(*cond, &block) | |
[0m[37m 243.7ms 842 | 992 _filter(:where, *cond, &block) | |
[0m[90m | 993 end | |
[0m[90m | 994 | |
[0m[90m .......[0m | |
[90m | 1101 # Internal filter method so it works on either the having or where clauses. | |
[0m[90m | 1102 def _filter(clause, *cond, &block) | |
[0m[37m 313.0ms 1788 | 1103 _filter_or_exclude(false, clause, *cond, &block) | |
[0m[90m | 1104 end | |
[0m[90m | 1105 | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/sql.rb | |
[90m | 978 # from_value_pairs(hash, :OR, true) | |
[0m[90m | 979 def self.from_value_pairs(pairs, op=:AND, negate=false) | |
[0m[37m 210.0ms 2881 | 980 pairs = pairs.map{|l,r| from_value_pair(l, r)} | |
[0m[90m | 981 pairs.map!{|ce| invert(ce)} if negate | |
[0m[90m | 982 pairs.length == 1 ? pairs.at(0) : new(op, *pairs) | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/core.rb | |
[90m | 307 DateTime.parse(string, convert_two_digit_years) | |
[0m[90m | 308 else | |
[0m[37m 640.8ms 4245 | 309 datetime_class.parse(string) | |
[0m[90m | 310 end | |
[0m[90m | 311 rescue => e | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/dataset/actions.rb | |
[90m | 55 def all(&block) | |
[0m[90m | 56 a = [] | |
[0m[31m 3218.3ms 346 | 57 each{|r| a << r} | |
[0m[90m | 58 post_load(a) | |
[0m[90m | 59 a.each(&block) if block | |
[0m[90m .......[0m | |
[90m | 116 aggregate_dataset.get{count(arg).as(count)} | |
[0m[90m | 117 else | |
[0m[37m 520.9ms 606 | 118 aggregate_dataset.get{count(:*){}.as(count)}.to_i | |
[0m[90m | 119 end | |
[0m[90m | 120 elsif block | |
[0m[90m .......[0m | |
[90m | 152 graph_each{|r| yield r} | |
[0m[90m | 153 elsif row_proc = @row_proc | |
[0m[31m 7109.3ms 4027 | 154 fetch_rows(select_sql){|r| yield row_proc.call(r)} | |
[0m[90m | 155 else | |
[0m[37m 459.3ms 202 | 156 fetch_rows(select_sql){|r| yield r} | |
[0m[90m | 157 end | |
[0m[90m | 158 self | |
[0m[90m .......[0m | |
[90m | 215 | |
[0m[90m | 216 if args.empty? | |
[0m[33m 1690.9ms 346 | 217 ds.single_record | |
[0m[90m | 218 else | |
[0m[90m | 219 args = (args.size == 1) ? args.first : args | |
[0m[90m .......[0m | |
[90m | 270 end | |
[0m[90m | 271 else | |
[0m[37m 479.6ms 101 | 272 ds.single_value | |
[0m[90m | 273 end | |
[0m[90m | 274 end | |
[0m[90m .......[0m | |
[90m | 435 end | |
[0m[90m | 436 else | |
[0m[33m 1724.2ms 200 | 437 super(&block) | |
[0m[90m | 438 end | |
[0m[90m | 439 end | |
[0m[90m .......[0m | |
[90m | 634 # this method. | |
[0m[90m | 635 def single_record | |
[0m[31m 2152.5ms 895 | 636 clone(:limit=>1).each{|r| return r} | |
[0m[90m | 637 nil | |
[0m[90m | 638 end | |
[0m[90m .......[0m | |
[90m | 642 # +get+ instead of this method. | |
[0m[90m | 643 def single_value | |
[0m[37m 477.9ms 303 | 644 if r = naked.ungraphed.single_record | |
[0m[90m | 645 r.values.first | |
[0m[90m | 646 end | |
[0m[90m .......[0m | |
[90m | 858 # :read_only server unless a specific server is set. | |
[0m[90m | 859 def execute(sql, opts={}, &block) | |
[0m[31m 6405.0ms 4473 | 860 @db.execute(sql, {:server=>@opts[:server] || :read_only}.merge(opts), &block) | |
[0m[90m | 861 end | |
[0m[90m | 862 | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/dataset/sql.rb | |
[90m | 78 case v | |
[0m[90m | 79 when Symbol | |
[0m[37m 206.5ms 3231 | 80 literal_symbol_append(sql, v) | |
[0m[90m | 81 when String | |
[0m[90m | 82 case v | |
[0m[90m .......[0m | |
[90m | 93 literal_hash_append(sql, v) | |
[0m[90m | 94 when SQL::Expression | |
[0m[37m 769.3ms 2537 | 95 literal_expression_append(sql, v) | |
[0m[90m | 96 when Float | |
[0m[90m | 97 sql << literal_float(v) | |
[0m[90m .......[0m | |
[90m | 134 def select_sql | |
[0m[90m | 135 return static_sql(@opts[:sql]) if @opts[:sql] | |
[0m[37m 641.1ms 895 | 136 clause_sql(:select) | |
[0m[90m | 137 end | |
[0m[90m | 138 | |
[0m[90m .......[0m | |
[90m | 883 def clause_sql(type) | |
[0m[90m | 884 sql = @opts[:append_sql] || sql_string_origin | |
[0m[37m 627.7ms 15215 | 885 send("#{type}_clause_methods").each{|x| send(x, sql)} | |
[0m[90m | 886 sql | |
[0m[90m | 887 end | |
[0m[90m .......[0m | |
[90m | 1005 end | |
[0m[90m | 1006 else | |
[0m[37m 229.4ms 3229 | 1007 literal_append(sql, v) | |
[0m[90m | 1008 end | |
[0m[90m | 1009 end | |
[0m[90m .......[0m | |
[90m | 1141 # SQL fragment for SQL::Expression, result depends on the specific type of expression. | |
[0m[90m | 1142 def literal_expression_append(sql, v) | |
[0m[37m 759.6ms 2537 | 1143 v.to_s_append(self, sql) | |
[0m[90m | 1144 end | |
[0m[90m | 1145 | |
[0m[90m .......[0m | |
[90m | 1373 if w = @opts[:where] | |
[0m[90m | 1374 sql << WHERE | |
[0m[37m 271.0ms 793 | 1375 literal_append(sql, w) | |
[0m[90m | 1376 end | |
[0m[90m | 1377 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/adapters/shared/postgres.rb | |
[90m | 1129 sql << PAREN_CLOSE | |
[0m[90m | 1130 else | |
[0m[37m 389.4ms 1093 | 1131 super | |
[0m[90m | 1132 end | |
[0m[90m | 1133 end | |
[0m | |
/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/sql.rb | |
[90m | 103 end | |
[0m[90m | 104 END | |
[0m[37m 748.3ms 2537 | 105 class_eval("def to_s_append(ds, sql) ds.#{meth}_append(sql, #{args}) end", __FILE__, __LINE__) | |
[0m[90m | 106 end | |
[0m[90m | 107 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/model/associations.rb | |
[90m | 1162 # Adds the association method to the association methods module. | |
[0m[90m | 1163 def def_association_method(opts) | |
[0m[31m 3433.8ms 445 | 1164 association_module_def(opts.association_method, opts){|*dynamic_opts, &block| load_associated_objects(opts, dynamic_opts[0], &block)} | |
[0m[90m | 1165 end | |
[0m[90m | 1166 | |
[0m[90m .......[0m | |
[90m | 1191 opts[:graph_join_table_join_type] ||= opts[:graph_join_type] | |
[0m[90m | 1192 opts[:after_load].unshift(:array_uniq!) if opts[:uniq] | |
[0m[37m 218.8ms 1984 | 1193 opts[:dataset] ||= proc{opts.associated_dataset.inner_join(join_table, rcks.zip(opts.right_primary_keys) + opts.predicate_keys.zip(lcpks.map{|k| send(k)}), :qualify=>:deep)} | |
[0m[90m | 1194 | |
[0m[90m | 1195 opts[:eager_loader] ||= proc do |eo| | |
[0m[90m .......[0m | |
[90m | 1549 # (or nil if no associated object). | |
[0m[90m | 1550 def _load_associated_object(opts, dynamic_opts) | |
[0m[33m 1276.6ms 491 | 1551 _load_associated_object_array(opts, dynamic_opts).first | |
[0m[90m | 1552 end | |
[0m[90m | 1553 | |
[0m[90m .......[0m | |
[90m | 1555 # as an array. | |
[0m[90m | 1556 def _load_associated_object_array(opts, dynamic_opts) | |
[0m[31m 3320.2ms 691 | 1557 _associated_dataset(opts, dynamic_opts).all | |
[0m[90m | 1558 end | |
[0m[90m | 1559 | |
[0m[90m .......[0m | |
[90m | 1563 if opts.can_have_associated_objects?(self) | |
[0m[90m | 1564 if opts.returns_array? | |
[0m[31m 2046.1ms 100 | 1565 _load_associated_object_array(opts, dynamic_opts) | |
[0m[90m | 1566 else | |
[0m[33m 1278.1ms 245 | 1567 _load_associated_object(opts, dynamic_opts) | |
[0m[90m | 1568 end | |
[0m[90m | 1569 elsif opts.returns_array? | |
[0m[90m .......[0m | |
[90m | 1637 associations[name] | |
[0m[90m | 1638 else | |
[0m[31m 3338.2ms 395 | 1639 objs = _load_associated_objects(opts, dynamic_opts) | |
[0m[90m | 1640 if opts.set_reciprocal_to_self? | |
[0m[90m | 1641 if opts.returns_array? | |
[0m[90m .......[0m | |
[90m | 1855 end | |
[0m[90m | 1856 else | |
[0m[37m 394.9ms 1093 | 1857 super | |
[0m[90m | 1858 end | |
[0m[90m | 1859 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/adapters/postgres.rb | |
[90m | 143 def execute(sql, args=nil) | |
[0m[90m | 144 args = args.map{|v| @db.bound_variable_arg(v, self)} if args | |
[0m[31m 2902.9ms 1786 | 145 q = check_disconnect_errors{execute_query(sql, args)} | |
[0m[90m | 146 begin | |
[0m[90m | 147 block_given? ? yield(q) : q.cmd_tuples | |
[0m[90m .......[0m | |
[90m | 156 # sql and args. | |
[0m[90m | 157 def execute_query(sql, args) | |
[0m[31m 3102.5ms 1786 | 158 @db.log_yield(sql, args){args ? async_exec(sql, args) : async_exec(sql)} | |
[0m[90m | 159 end | |
[0m[90m | 160 end | |
[0m[90m .......[0m | |
[90m | 277 # Execute the given SQL with the given args on an available connection. | |
[0m[90m | 278 def execute(sql, opts={}, &block) | |
[0m[31m 12709.5ms 2679 | 279 synchronize(opts[:server]){|conn| check_database_errors{_execute(conn, sql, opts, &block)}} | |
[0m[90m | 280 end | |
[0m[90m | 281 | |
[0m[90m .......[0m | |
[90m | 442 end | |
[0m[90m | 443 else | |
[0m[37m 842.2ms 4245 | 444 super | |
[0m[90m | 445 end | |
[0m[90m | 446 end | |
[0m[90m .......[0m | |
[90m | 453 execute_prepared_statement(conn, sql, opts, &block) | |
[0m[90m | 454 else | |
[0m[31m 6309.4ms 893 | 455 conn.execute(sql, opts[:arguments], &block) | |
[0m[90m | 456 end | |
[0m[90m | 457 end | |
[0m[90m .......[0m | |
[90m | 596 def fetch_rows(sql) | |
[0m[90m | 597 return cursor_fetch_rows(sql){|h| yield h} if @opts[:cursor] | |
[0m[31m 9800.2ms 2683 | 598 execute(sql){|res| yield_hash_rows(res, fetch_rows_set_cols(res)){|h| yield h}} | |
[0m[90m | 599 end | |
[0m[90m | 600 | |
[0m[90m .......[0m | |
[90m | 788 # keys and typecasted values. | |
[0m[90m | 789 def yield_hash_rows(res, cols) | |
[0m[31m 3206.9ms 1790 | 790 res.ntuples.times do |recnum| | |
[0m[90m | 791 converted_rec = {} | |
[0m[33m 1473.6ms 2542 | 792 cols.each do |fieldnum, type_proc, fieldsym| | |
[0m[90m | 793 value = res.getvalue(recnum, fieldnum) | |
[0m[33m 1130.1ms 101946 | 794 converted_rec[fieldsym] = (value && type_proc) ? type_proc.call(value) : value | |
[0m[90m | 795 end | |
[0m[90m | 796 yield converted_rec | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/database/connecting.rb | |
[90m | 233 # end | |
[0m[90m | 234 def synchronize(server=nil) | |
[0m[31m 6385.2ms 894 | 235 @pool.hold(server || :default){|conn| yield conn} | |
[0m[90m | 236 end | |
[0m[90m | 237 else | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.7.1.180/lib/sequel/extensions/newrelic_instrumentation.rb | |
[90m | 40 | |
[0m[90m | 41 t0 = Time.now | |
[0m[33m 1148.5ms 893 | 42 rval = super | |
[0m[90m | 43 t1 = Time.now | |
[0m[90m | 44 | |
[0m[90m | 45 begin | |
[0m[90m | 46 duration = t1 - t0 | |
[0m[37m 905.9ms 895 | 47 record_metrics( sql, args, duration ) | |
[0m[37m 731.4ms 895 | 48 notice_sql( sql, args, t0, t1 ) | |
[0m[90m | 49 rescue => err | |
[0m[90m | 50 NewRelic::Agent.logger.debug "while recording metrics for Sequel", err | |
[0m[90m .......[0m | |
[90m | 60 engine = NewRelic::Agent.instance.stats_engine | |
[0m[90m | 61 | |
[0m[37m 362.3ms 895 | 62 engine.record_metrics( primary_metric, duration, :scoped => true ) | |
[0m[90m | 63 | |
[0m[90m | 64 metrics = rollup_metrics_for( primary_metric ) | |
[0m[90m | 65 metrics << remote_service_metric( *self.opts.values_at(:adapter, :host) ) if self.opts.key?(:adapter) | |
[0m[90m | 66 | |
[0m[37m 344.5ms 895 | 67 engine.record_metrics( metrics, duration, :scoped => false ) | |
[0m[90m | 68 end | |
[0m[90m | 69 | |
[0m[90m .......[0m | |
[90m | 77 | |
[0m[90m | 78 begin | |
[0m[37m 211.4ms 895 | 79 scope = agent.stats_engine.push_scope( :sequel, start ) | |
[0m[90m | 80 agent.transaction_sampler.notice_sql( sql, self.opts, duration ) do |*| | |
[0m[90m | 81 self[ sql ].explain | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/database/logging.rb | |
[90m | 40 raise | |
[0m[90m | 41 ensure | |
[0m[37m 913.8ms 5370 | 42 log_duration(Time.now - start, sql) unless e | |
[0m[90m | 43 end | |
[0m[90m | 44 end | |
[0m[90m .......[0m | |
[90m | 62 # warn level if duration is greater than log_warn_duration. | |
[0m[90m | 63 def log_duration(duration, message) | |
[0m[37m 848.4ms 1790 | 64 log_each((lwd = log_warn_duration and duration >= lwd) ? :warn : sql_log_level, "(#{sprintf('%0.6fs', duration)}) #{message}") | |
[0m[90m | 65 end | |
[0m[90m | 66 | |
[0m[90m .......[0m | |
[90m | 68 # to all loggers. | |
[0m[90m | 69 def log_each(level, message) | |
[0m[37m 839.0ms 1790 | 70 @loggers.each{|logger| logger.send(level, message)} | |
[0m[90m | 71 end | |
[0m[90m | 72 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.7.1.180/lib/new_relic/agent/stats_engine/metric_stats.rb | |
[90m | 26 | |
[0m[90m | 27 if in_transaction? | |
[0m[37m 314.5ms 3580 | 28 transaction_stats_hash.record(specs, value, &blk) | |
[0m[90m | 29 else | |
[0m[90m | 30 with_stats_lock do | |
[0m[90m .......[0m | |
[90m | 188 | |
[0m[90m | 189 def in_transaction? | |
[0m[37m 205.1ms 3580 | 190 !!transaction_stats_hash | |
[0m[90m | 191 end | |
[0m[90m | 192 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/database/misc.rb | |
[90m | 275 # the database does not have a timezone. | |
[0m[90m | 276 def to_application_timestamp(v) | |
[0m[37m 816.9ms 8490 | 277 Sequel.convert_timestamp(v, timezone) | |
[0m[90m | 278 end | |
[0m[90m | 279 | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/timezones.rb | |
[90m | 73 end | |
[0m[90m | 74 else | |
[0m[37m 762.9ms 8490 | 75 convert_output_timestamp(convert_input_timestamp(v, input_timezone), application_timezone) | |
[0m[90m | 76 end | |
[0m[90m | 77 rescue InvalidValue | |
[0m[90m .......[0m | |
[90m | 132 case v | |
[0m[90m | 133 when String | |
[0m[37m 723.0ms 4245 | 134 v2 = Sequel.string_to_datetime(v) | |
[0m[90m | 135 if !input_timezone || Date._parse(v).has_key?(:offset) | |
[0m[90m | 136 v2 | |
[0m | |
/var/vcap/data/packages/ruby/11.1/lib/ruby/1.9.1/time.rb | |
[90m | 263 def parse(date, now=self.now) | |
[0m[90m | 264 comp = !block_given? | |
[0m[37m 408.5ms 59430 | 265 d = Date._parse(date, comp) | |
[0m[90m | 266 if !d[:year] && !d[:mon] && !d[:mday] && !d[:hour] && !d[:min] && !d[:sec] && !d[:sec_fraction] | |
[0m[90m | 267 raise ArgumentError, "no time information in #{date.inspect}" | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/plugins/dirty.rb | |
[90m | 127 def set_values(hash) | |
[0m[90m | 128 reset_initial_values | |
[0m[37m 429.9ms 2441 | 129 super | |
[0m[90m | 130 end | |
[0m[90m | 131 | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/plugins/typecast_on_load.rb | |
[90m | 44 # with the current value, so it can be typecasted correctly. | |
[0m[90m | 45 def load_typecast | |
[0m[37m 361.3ms 4882 | 46 model.typecast_on_load_columns.each do |c| | |
[0m[90m | 47 if v = values[c] | |
[0m[37m 332.5ms 5180 | 48 send("#{c}=", v) | |
[0m[90m | 49 end | |
[0m[90m | 50 end | |
[0m[90m .......[0m | |
[90m | 57 def set_values(values) | |
[0m[90m | 58 ret = super | |
[0m[37m 394.2ms 2441 | 59 load_typecast | |
[0m[90m | 60 ret | |
[0m[90m | 61 end | |
[0m | |
lib/cloud_controller/models.rb | |
[90m | 27 def user_visible_relationship_dataset(name, user, admin_override = false) | |
[0m[90m | 28 associated_model = self.class.association_reflection(name).associated_class | |
[0m[31m 2661.0ms 2531 | 29 relationship_dataset(name).filter(associated_model.user_visibility(user, admin_override)) | |
[0m[90m | 30 end | |
[0m[90m | 31 end | |
[0m | |
lib/cloud_controller/rest_controller/paginator.rb | |
[90m | 88 def resources | |
[0m[90m | 89 @paginated.all.map do |m| | |
[0m[31m 6970.0ms 48 | 90 @serialization.to_hash(@controller, m, @opts) | |
[0m[90m | 91 end | |
[0m[90m | 92 end | |
[0m | |
vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/plugins/serialization.rb | |
[90m | 181 def set_values(hash) | |
[0m[90m | 182 @deserialized_values.clear if @deserialized_values | |
[0m[37m 356.7ms 1950 | 183 super | |
[0m[90m | 184 end | |
[0m[90m | 185 | |
[0m | |
/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/model/base.rb | |
[90m | 767 meth = "#{column}=" | |
[0m[90m | 768 overridable_methods_module.module_eval("def #{column}; self[:#{column}] end", __FILE__, __LINE__) unless im.include?(column.to_s) | |
[0m[37m 314.7ms 2590 | 769 overridable_methods_module.module_eval("def #{meth}(v); self[:#{column}] = v end", __FILE__, __LINE__) unless im.include?(meth) | |
[0m[90m | 770 end | |
[0m[90m | 771 end | |
[0m | |
lib/sequel_plugins/vcap_normalization.rb | |
[90m | 4 def []=(k, v) | |
[0m[90m | 5 v = strip_if_needed(k, v) | |
[0m[37m 252.9ms 2590 | 6 super(k, v) | |
[0m[90m | 7 end | |
[0m[90m | 8 | |
[0m | |
lib/cloud_controller/rest_controller/object_serialization.rb | |
[90m | 53 # @return [Hash] Hash encoding of the object. | |
[0m[90m | 54 def self.to_hash(controller, obj, opts, depth=0, parents=[]) | |
[0m[31m 9692.2ms 195 | 55 rel_hash = relations_hash(controller, obj, opts, depth, parents) | |
[0m[33m 1395.2ms 990 | 56 entity_hash = obj.to_hash.merge(rel_hash) | |
[0m[90m | 57 | |
[0m[90m | 58 metadata_hash = { | |
[0m[90m .......[0m | |
[90m | 73 max_number_of_associated_objects_to_inline = opts[:max_inline] || MAX_INLINE_DEFAULT | |
[0m[90m | 74 | |
[0m[31m 9691.2ms 195 | 75 {}.tap do |res| | |
[0m[90m | 76 parents.push(controller) | |
[0m[31m 4743.7ms 394 | 77 res.merge!(serialize_relationships(controller.to_one_relationships, controller, depth, obj, opts, parents, inline_relations_depth)) | |
[0m[31m 5040.1ms 395 | 78 res.merge!(serialize_relationships(controller.to_many_relationships, controller, depth, obj, opts, parents, inline_relations_depth, max_number_of_associated_objects_to_inline)) | |
[0m[90m | 79 parents.pop | |
[0m[90m | 80 end | |
[0m[90m .......[0m | |
[90m | 83 def self.serialize_relationships(relationships, controller, depth, obj, opts, parents, inline_relations_depth, max_number_of_associated_objects_to_inline= nil) | |
[0m[90m | 84 response = {} | |
[0m[31m 9781.0ms 393 | 85 (relationships || {}).each do |association_name, association| | |
[0m[90m | 86 | |
[0m[90m | 87 associated_model = get_associated_model_klazz_for(obj, association_name) | |
[0m[90m .......[0m | |
[90m | 90 associated_controller = get_controller_for(associated_model) | |
[0m[90m | 91 | |
[0m[31m 2691.9ms 843 | 92 associated_model_instances = obj.user_visible_relationship_dataset(association_name, | |
[0m[90m | 93 VCAP::CloudController::SecurityContext.current_user, | |
[0m[90m | 94 VCAP::CloudController::SecurityContext.admin?) | |
[0m[90m | 95 | |
[0m[90m | 96 associated_url = association_endpoint( | |
[0m[33m 1271.6ms 843 | 97 controller, associated_controller, obj, associated_model_instances, association) | |
[0m[90m | 98 | |
[0m[90m | 99 response["#{association_name}_url"] = associated_url if associated_url | |
[0m[90m .......[0m | |
[90m | 102 if depth < inline_relations_depth && !parents.include?(associated_controller) | |
[0m[90m | 103 if association.is_a?(ControllerDSL::ToOneAttribute) | |
[0m[37m 448.4ms 100 | 104 associated_model_instance = associated_model_instances.first | |
[0m[90m | 105 if associated_model_instance | |
[0m[31m 2889.2ms 299 | 106 response[association_name.to_s] = to_hash(associated_controller, associated_model_instance, opts, depth + 1, parents) | |
[0m[90m | 107 end | |
[0m[90m | 108 else | |
[0m[37m 510.7ms 100 | 109 if associated_model_instances.count <= max_number_of_associated_objects_to_inline | |
[0m[33m 1725.2ms 300 | 110 response[association_name.to_s] = associated_model_instances.map do |associated_model_instance| | |
[0m[33m 1211.2ms 48 | 111 to_hash(associated_controller, associated_model_instance, opts, depth + 1, parents) | |
[0m[90m | 112 end | |
[0m[90m | 113 end | |
[0m[90m .......[0m | |
[90m | 133 def self.association_endpoint(controller, associated_controller, obj, associated_model_instances, association) | |
[0m[90m | 134 if association.is_a?(ControllerDSL::ToOneAttribute) | |
[0m[33m 1240.2ms 245 | 135 if (associated_model_instance = associated_model_instances.first) | |
[0m[90m | 136 associated_controller.url_for_guid(associated_model_instance.guid) | |
[0m[90m | 137 end | |
[0m | |
lib/sequel_plugins/vcap_relations.rb | |
[90m | 21 reflection = self.class.association_reflection(association) | |
[0m[90m | 22 if (dataset = reflection[:dataset]) | |
[0m[31m 2589.6ms 843 | 23 instance_exec(&dataset) | |
[0m[90m | 24 else | |
[0m[90m | 25 reflection.associated_class.dataset | |
[0m[90m .......[0m | |
[90m | 99 | |
[0m[90m | 100 define_method(guid_attr) do | |
[0m[33m 1070.4ms 246 | 101 other = send(name) | |
[0m[90m | 102 other.guid unless other.nil? | |
[0m[90m | 103 end | |
[0m | |
/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/1.9.1/gems/sequel-3.48.0/lib/sequel/dataset/query.rb | |
[90m | 588 | |
[0m[90m | 589 CONDITIONED_JOIN_TYPES.each do |jtype| | |
[0m[37m 202.2ms 248 | 590 class_eval("def #{jtype}_join(*args, &block); join_table(:#{jtype}, *args, &block) end", __FILE__, __LINE__) | |
[0m[90m | 591 end | |
[0m[90m | 592 UNCONDITIONED_JOIN_TYPES.each do |jtype| | |
[0m | |
app/models/runtime/space.rb | |
[90m | 17 one_to_many :managed_service_instances | |
[0m[90m | 18 one_to_many :routes | |
[0m[33m 1896.5ms 100 | 19 one_to_many :app_events, dataset: -> { AppEvent.filter(app: apps) } | |
[0m[90m | 20 one_to_many :default_users, class: "VCAP::CloudController::User", key: :default_space_id | |
[0m[37m 289.8ms 99 | 21 one_to_many :domains, dataset: -> { organization.domains_dataset } | |
[0m[90m | 22 | |
[0m[90m | 23 add_association_dependencies default_users: :nullify, apps: :destroy, service_instances: :destroy, routes: :destroy, events: :nullify | |
[0m | |
lib/sequel_plugins/vcap_serialization.rb | |
[90m | 18 hash = {} | |
[0m[90m | 19 attrs = self.class.export_attrs || [] | |
[0m[33m 1390.1ms 198 | 20 attrs.each do |k| | |
[0m[90m | 21 if opts[:only].nil? || opts[:only].include?(k) | |
[0m[33m 1360.9ms 1294 | 22 value = send(k) | |
[0m[90m | 23 if value.respond_to?(:nil_object?) && value.nil_object? | |
[0m[90m | 24 hash[k.to_s] = nil | |
[0m | |
app/models/runtime/app.rb | |
[90m | 283 | |
[0m[90m | 284 def system_env_json | |
[0m[37m 228.8ms 50 | 285 vcap_services | |
[0m[90m | 286 end | |
[0m[90m | 287 | |
[0m[90m .......[0m | |
[90m | 507 def vcap_services | |
[0m[90m | 508 services_hash = {} | |
[0m[37m 228.4ms 100 | 509 self.service_bindings.each do |sb| | |
[0m[90m | 510 binding = ServiceBindingPresenter.new(sb).to_hash | |
[0m[90m | 511 service = service_binding_json(binding) | |
[0m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment