Created
September 9, 2011 09:15
-
-
Save priteau/1205815 to your computer and use it in GitHub Desktop.
Compute the number of nodes on Grid'5000
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'restfully' | |
| grid = Restfully::Session.new(:base_uri => 'https://api.grid5000.fr/sid/grid5000').root | |
| nnodes = grid.sites.inject(0) do |sum, s| | |
| sum + s.clusters.inject(0) do |sum, c| | |
| sum + c.nodes.length | |
| end | |
| end | |
| puts nnodes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment