Skip to content

Instantly share code, notes, and snippets.

@fitzchak
Created March 21, 2013 15:02
Show Gist options
  • Save fitzchak/5213723 to your computer and use it in GitHub Desktop.
Save fitzchak/5213723 to your computer and use it in GitHub Desktop.
Test UserTokenTTL
using System;
using System.Diagnostics;
using System.Net;
using System.Threading;
using Raven.Client.Document;
using System.Linq;
namespace Raven.Tryouts
{
public class Album
{
public string AlbumArtUrl { get; set; }
public AlbumArtist Artist { get; set; }
public AlbumGenre Genre { get; set; }
public float Price { get; set; }
public string Title { get; set; }
public int CountSold { get; set; }
public class AlbumArtist
{
public string Id { get; set; }
public string Name { get; set; }
}
public class AlbumGenre
{
public string Id { get; set; }
public string Name { get; set; }
}
}
class Program
{
static void Main(string[] args)
{
using (var store = new DocumentStore {Url ="http://localhost:8811", DefaultDatabase = "TestDB", Credentials = new NetworkCredential("User", "Password")}.Initialize())
{
var i = 0;
while (true)
{
var sw = Stopwatch.StartNew();
Console.WriteLine("Start query " + ++i + " at " + DateTime.Now.ToString("hh:mm:ss.fffffff"));
using (var session = store.OpenSession())
{
var albums = session.Query<Album>().ToList();
Console.WriteLine("Docs: " + albums.Count + " Elapsed " + sw.ElapsedMilliseconds);
}
Thread.Sleep(TimeSpan.FromMinutes(1));
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment