Skip to content

Instantly share code, notes, and snippets.

@papajuans
Created January 28, 2016 13:52
Show Gist options
  • Save papajuans/f0d8ee0a92dbfda9c2e8 to your computer and use it in GitHub Desktop.
Save papajuans/f0d8ee0a92dbfda9c2e8 to your computer and use it in GitHub Desktop.
'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