Module ActiveLdap::ActionController::LdapBenchmarking
In: lib/active_ldap/action_controller/ldap_benchmarking.rb
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid LdapError DistinguishedNameNotSetError EntryNotFound SaveError StrongAuthenticationRequired NotImplemented AdapterNotFound TimeoutError AuthenticationError AttributeValueInvalid EntryNotSaved DistinguishedNameInputInvalid EntryAlreadyExist ObjectClassError UnknownAttribute EntryInvalid DeleteError ConfigurationError ConnectionNotSetup DistinguishedNameInvalid Schema\n[lib/active_ldap/schema.rb\nlib/active_ldap/schema/syntaxes.rb] DistinguishedName Base Reloadable::Deprecated Reloadable::Subclasses Enumerable Ldif Collection EntryAttribute StandardError Children HasManyWrap HasMany BelongsToMany Proxy BelongsTo Common Find LDIF Delete Update GetText::Translation Normalizable GetText Parser ActiveRecord::Callbacks ActiveRecord::Validations Base\n[lib/active_ldap/adapter/base.rb\nlib/active_ldap/adapter/jndi.rb\nlib/active_ldap/adapter/ldap.rb\nlib/active_ldap/adapter/net_ldap.rb] Jndi Ldap NetLdap GetTextSupport Xml JndiConnection lib/active_ldap/distinguished_name.rb lib/active_ldap/base.rb lib/active_ldap/schema/syntaxes.rb lib/active_ldap/xml.rb lib/active_ldap/entry_attribute.rb lib/active_ldap/ldif.rb lib/active_ldap/ldap_error.rb Compatible ClassMethods Associations LdapBenchmarking ActionController Populate lib/active_ldap/association/has_many_wrap.rb lib/active_ldap/association/children.rb lib/active_ldap/association/collection.rb lib/active_ldap/association/proxy.rb lib/active_ldap/association/belongs_to_many.rb lib/active_ldap/association/belongs_to.rb lib/active_ldap/association/has_many.rb HasManyUtils Association ClassMethods Tree Acts Command Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations GetTextSupport Escape ClassMethods Normalizable Attributes ClassMethods Configuration ClassMethods ObjectClass lib/active_ldap/get_text/parser.rb GetText ClassMethods Callbacks Validations lib/active_ldap/adapter/jndi_connection.rb lib/active_ldap/adapter/net_ldap.rb lib/active_ldap/adapter/ldap.rb lib/active_ldap/adapter/jndi.rb Adapter Helper Translation GetTextFallback ClassMethods HumanReadable Salt UserPassword ClassMethods Connection ActiveLdap dot/m_46_0.png

Methods

Public Class methods

[Source]

    # File lib/active_ldap/action_controller/ldap_benchmarking.rb, line 4
 4:       def self.included(base)
 5:         base.class_eval do
 6:           alias_method_chain :render_with_benchmark, :active_ldap
 7:           if private_method_defined?(:view_runtime)
 8:             alias_method_chain :view_runtime, :active_ldap
 9:           else
10:             alias_method_chain :rendering_runtime, :active_ldap
11:           end
12:         end
13:       end

Protected Instance methods

[Source]

    # File lib/active_ldap/action_controller/ldap_benchmarking.rb, line 16
16:       def render_with_benchmark_with_active_ldap(*args, &block)
17:         if logger
18:           ldap_runtime_before_render = ActiveLdap::Base.reset_runtime
19:         end
20:         result = render_with_benchmark_without_active_ldap(*args, &block)
21:         if logger
22:           @ldap_runtime_before_render = ldap_runtime_before_render
23:           @ldap_runtime_after_render = ActiveLdap::Base.reset_runtime
24:           if defined?(@rendering_runtime)
25:             @rendering_runtime -= @ldap_runtime_after_render
26:           else
27:             @view_runtime -= @ldap_runtime_after_render
28:           end
29:         end
30:         result
31:       end

Private Instance methods

[Source]

    # File lib/active_ldap/action_controller/ldap_benchmarking.rb, line 34
34:       def rendering_runtime_with_active_ldap(runtime)
35:         result = rendering_runtime_without_active_ldap(runtime)
36:         ldap_runtime = ActiveLdap::Base.reset_runtime
37:         ldap_runtime += @ldap_runtime_before_render || 0
38:         ldap_runtime += @ldap_runtime_after_render || 0
39:         ldap_percentage = ldap_runtime * 100 / runtime
40:         result + (" | LDAP: %.5f (%d%%)" % [ldap_runtime, ldap_percentage])
41:       end

[Source]

    # File lib/active_ldap/action_controller/ldap_benchmarking.rb, line 43
43:       def view_runtime_with_active_ldap
44:         result = view_runtime_without_active_ldap
45:         ldap_runtime = ActiveLdap::Base.reset_runtime
46:         @ldap_runtime_before_render ||= 0
47:         @ldap_runtime_after_render ||= 0
48:         ldap_runtime += @ldap_runtime_before_render
49:         ldap_runtime += @ldap_runtime_after_render
50:         result + (", LDAP: %.0f" % (ldap_runtime * 1000))
51:       end

[Validate]