Created
January 28, 2016 13:52
-
-
Save papajuans/f0d8ee0a92dbfda9c2e8 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
var levelup = require('levelup') | |
var fs = require('fs'); | |
var db = levelup('./ldb'); | |
var bytes = fs.readFileSync('./image.jpeg', 'binary'); | |
var c = 0; | |
setInterval(function() { | |
console.log(db.db.getProperty('leveldb.stats')) | |
}, 1000); | |
setInterval(function() { | |
db.put('k', bytes, function() { | |
db.del('k', function() { | |
console.log(++c + ' cycle ' + bytes.length); | |
}); | |
}); | |
}, 50); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment