Code Monkey home page Code Monkey logo

power_grid's Introduction

power_grid

Multi-Thread a Traversal to find the energization status of a power grid

Instructions

  1. Build it:

     mvn clean package
    
  2. Copy target/power-grid-1.0-SNAPSHOT.jar to the plugins/ directory of your Neo4j server.

  3. Download additional jars to the plugins/ directory of your Neo4j server.

     http://central.maven.org/maven2/org/roaringbitmap/RoaringBitmap/0.6.27/RoaringBitmap-0.6.27.jar
    
  4. Configure Neo4j by adding a line to conf/neo4j.conf on version >= 3.0:

     dbms.unmanaged_extension_classes=net.geirina=/v1
    
  5. Start Neo4j server.

  6. Check that the extension is installed correctly over HTTP:

     :GET /v1/service/helloworld
    
  7. Warm up the database:

     :GET /v1/service/warmup
    
  8. Run this command to add an index on Equipment(equipment_id):

     :POST /v1/schema/create
    
  9. Run the command:

     :POST /v1/energization/ {"ids":["1"]}
    
  10. Clear the results:

    :POST /v1/energization/clear
    
  11. Try the SPI version:

     :POST /v1/energization/spi {"ids":["1"]}
    
  12. Clear the results:

    :POST /v1/energization/clear
    
  13. Try the streaming version:

    :POST /v1/energization/streaming {"ids":["1"]}           
    
  14. Clear it again and try the multi-threaded version:

    :POST /v1/energization/clear
    :POST /v1/energization/multi {"ids":["1"]}
    
  15. Performance Testing:

    curl -u neo4j:swordfish -w "@format.txt" -o /dev/null -s -H "Content-Type: application/json" -X POST -d '{ "ids" : ["1"]}' http://localhost:7474/v1/energization
    curl -u neo4j:swordfish -H "Content-Type: application/json" -X POST http://localhost:7474/v1/energization/clear
    curl -u neo4j:swordfish -w "@format.txt" -o /dev/null -s -H "Content-Type: application/json" -X POST -d '{ "ids" : ["1"]}' http://localhost:7474/v1/energization/spi
    curl -u neo4j:swordfish -H "Content-Type: application/json" -X POST http://localhost:7474/v1/energization/clear
    curl -u neo4j:swordfish -w "@format.txt" -o /dev/null -s -H "Content-Type: application/json" -X POST -d '{ "ids" : ["1"]}' http://localhost:7474/v1/energization/streaming
    curl -u neo4j:swordfish -H "Content-Type: application/json" -X POST http://localhost:7474/v1/energization/clear
    curl -u neo4j:swordfish -w "@format.txt" -o /dev/null -s -H "Content-Type: application/json" -X POST -d '{ "ids" : ["1"]}' http://localhost:7474/v1/energization/multi
    

power_grid's People

Contributors

maxdemarzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.