Last active
August 29, 2015 14:07
-
-
Save kijanawoodard/92c9cec91e1a72b756da to your computer and use it in GitHub Desktop.
Voron Scratch Buffers
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
namespace VoronScratchTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using ( | |
var store = | |
new DocumentStore | |
{ | |
Url = "http://localhost:8080", | |
DefaultDatabase = "VoronScratchTest" | |
}.Initialize()) | |
{ | |
string id; | |
using (var session = store.OpenSession()) | |
{ | |
var doc = new Scratch {Id = "scratch/"}; | |
session.Store(doc); | |
session.SaveChanges(); | |
id = doc.Id; | |
} | |
for (var i=0; i< long.MaxValue; i++) | |
{ | |
using (var session = store.OpenSession()) | |
{ | |
var doc = session.Load<Scratch>(id); | |
doc.Value = i; | |
session.SaveChanges(); | |
} | |
Thread.Sleep(10); | |
if (i%(10*1000) == 0) Console.Write("."); | |
} | |
} | |
} | |
} | |
public class Scratch | |
{ | |
public string Id { get; set; } | |
public long Value { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment