From 028a6522768b20bc742ed0d44e5f851157f12960 Mon Sep 17 00:00:00 2001 From: Michael Phan-Ba Date: Sat, 11 Feb 2012 20:35:21 -0800 Subject: [PATCH] Remove dumpdata.js --- demo/dumpdata.js | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 demo/dumpdata.js diff --git a/demo/dumpdata.js b/demo/dumpdata.js deleted file mode 100644 index 5d07a91..0000000 --- a/demo/dumpdata.js +++ /dev/null @@ -1,46 +0,0 @@ -var leveldb = require('../build/leveldb.node'), - DB = leveldb.DB, - Iterator = leveldb.Iterator; - -var path = "/tmp/large.db"; - -var index = 0; -var in_flight = 0; -var found = 0; -var not_found = 0; - -var db = new DB(); -db.open(path, function(err) { - if (err) throw err; - - setInterval(function() { - console.log('Index: ' + index + ' In flight: ' + in_flight + ' Found: ' + found + ' Not found: ' + not_found); - refresh(); - }, 100); - - refresh(); -}); - -function refresh() { - while (in_flight < 10000) { - var key = "row" + index; - - db.get(key, (function(index) { return function(err, value) { - in_flight -= 1; - if (value) { - var obj = JSON.parse(value); - if (obj.index != index) { - console.log('key: ' + key + ' = ' + value); - } - found += 1; - } - else { - not_found += 1; - } - }})(index)); - - in_flight += 1; - index += 1; - } -} -