node_stats.rb 387 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. require 'neo4j'
  3. # Node setup
  4. class NodeStats
  5. include Neo4j::ActiveNode
  6. property :node_id, constraint: :unique
  7. property :cpu_max
  8. property :cpu_avg
  9. property :mem_max
  10. property :mem_avg
  11. has_one :out, :node, rel_class: :Node2Stats
  12. end
  13. class Node2Stats
  14. include Neo4j::ActiveRel
  15. from_class :Node
  16. to_class :NodeStats
  17. type :node
  18. end