Created
May 30, 2014 04:09
-
-
Save greglearns/c6072f47db58ddb4ba30 to your computer and use it in GitHub Desktop.
GT.M + Node.js on Ubuntu 14.04 via Vagrant
This file contains 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
# using ubuntu/trusty64 | |
sudo apt-get install fis-gtm -y | |
/usr/lib/fis-gtm/V6.0-003_x86_64/gtm -direct | |
sudo ln -s /usr/lib/fis-gtm/V6.0-003_x86_64/libgtmshr.so /usr/local/lib/libgtmshr.so | |
sudo ldconfig | |
sudo apt-get install npm -y | |
sudo apt-get install nodejs -y | |
# npm init | |
npm install -S nodem | |
export gtm_dist='/usr/lib/fis-gtm/V6.0-003_x86_64' | |
export gtmgbldir=/home/vagrant/.fis-gtm/V6.0-003_x86_64/g/gtm | |
export gtmroutines="${HOME}/node_modules/nodem/src" | |
export GTMCI=${HOME}/node_modules/nodem/resources/calltab.ci | |
export LD_LIBRARY_PATH=${gtm_dist}:${LD_LIBRARY_PATH} | |
export gtmdir='.fis-gtm' | |
export gtmver='V6.0-003_x86_64' | |
NOTE: this will break things: export gtmroutines="$HOME/data/gtm/o($HOME/data/gtm/r) $gtm_dist/libgtmutil.so $gtm_dist" | |
nodejs | |
# paste this into node | |
var gtm = require('nodem') | |
var db = new gtm.Gtm(); | |
//db.open({namespace: '/home/vagrant/.fis-gtm/V6.0-003_x86_64/g/gtm.gld'}); | |
db.open(); | |
var node; | |
var ret; | |
console.log('Testing the set command, starting at: ' + Date()); | |
for (var i = 0; i < 1000000; i++) { | |
node = {global: 'dlw', subscripts: ["testing", i], data: 'record ' + i}; | |
ret = db.set(node); | |
if (ret.ok == 0) { | |
break; | |
} | |
} | |
console.log('done at '+ Date()) | |
if (ret.ok == 1) { | |
console.log('Set a million nodes in ^dlw("testing"), ending at: ' + Date()); | |
} else { | |
console.log('There was an error: ' + ret.errorCode + ' ' + ret.errorMessage); | |
} | |
db.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment