Skip to content

Instantly share code, notes, and snippets.

@veikkoeeva
veikkoeeva / orleans_persistence_stress_tests.sql
Created March 2, 2021 20:06
Some Orleans stress testing
-- The index being NONCLUSTERED is by design. The intent is that when
-- a grain is added to the Storage, deletting it, or setting it to "NULL"
-- in application code will only SET NULL to the Payload fields. This
-- should prevent alleviate need for index or statistics maintenance
-- with the loss of some bytes of storage space. Naturally the DB
-- can be scrubbed with a separate maintenance operation.
--
-- This design should be fast on lower number of rows, but scale
-- quite well even to the largest reasonable table sizes.
@veikkoeeva
veikkoeeva / RecordSet.cs
Last active May 10, 2018 18:06
RecordSet
/// <summary>
/// A set of records.
/// </summary>
/// <typeparam name="TKey">The key type of records.</typeparam>
/// <typeparam name="TValue">The value type of records.</typeparam>
[Serializable]
[DebuggerTypeProxy(typeof(CollectionDebugView<>))]
[DebuggerDisplay("Count = {Count}")]
public class RecordSet<TKey, TValue>: ICollection<KeyValuePair<TKey, TValue>>
{
@veikkoeeva
veikkoeeva / ISystemInformation.cs
Last active March 17, 2016 08:06
System information query example
/// <summary>
/// An interface to query system information.
/// </summary>
/// <remarks>
/// The system WMI tables are listed at <see href="https://msdn.microsoft.com/en-us/library/bg126473(v=vs.85).aspx">WMI/MI/OMI Providers</see>
/// Programmatically the tables can be queries like
/// <code>
/// var wmiSearcher = new ManagementObjectSearcher("SELECT * FROM meta_class WHERE __CLASS LIKE 'Win32_%'");
/// foreach(var obj in wmiSearcher.Get()) Console.WriteLine(obj["__CLASS"]);
/// </code>
@veikkoeeva
veikkoeeva / gist:4414609e828375c898f3
Last active January 17, 2017 16:52
Custom Orleans host in F#
namespace OrleansHostingUtilities
open System
open Orleans.Runtime.Configuration
open Orleans.Runtime
open System.Reflection
open System.Globalization
open System.Threading
open System.Net