Module: Pacer::Utils::GraphAnalysis::Route

Defined in:
lib/pacer/utils/graph_analysis.rb

Instance Method Summary collapse

Instance Method Details

#property_variations(result, node) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/pacer/utils/graph_analysis.rb', line 67

def property_variations(result, node)
  prop_keys = group_count { |v| v.properties.keys.sort }
  prop_keys.each do |keys, count|
    prop_key = result.v(:element_type => 'property keys').detect { |v| v[:keys] == keys }
    unless prop_key
      prop_key = result.create_vertex :element_type => 'property keys', :keys => keys, :number => keys.count, :count => 0
    end
    prop_key[:count] += count
    puts "  #{ count } with #{ keys.count } properties: #{ keys.inspect }"
    node.add_edges_to :properties, prop_key, :count => count
  end
end