anchor.diff:  open Microsoft.Diagnostics.Tracing
   open Microsoft.Diagnostics.Tracing.Session
   open System.Reactive.Subjects
  -
  -// Do we need unique sessions for azmon processes? (difficult to clean up)
  -// Should we use unique sessions for sets of sources? So should azmon processes
  -// listening to Foo and Bar events share the same session? (difficult to clean up)
  -// Keeping the session alive's useful for protecting against azmon crashes
  -// Do TraceEventSessions survive reboots? (Probably not: other kernel objects like
  -// monitors & sockets don't)
   
   // Problems:
   //* Tests are SUPER flaky
  
positive.code:     with
      interface System.IDisposable with
          member x.Dispose() =
              x.Subject.Dispose()
  
  let (|Null|Value|) (x: System.Nullable<_>) =
      // Apparently GetValueOrDefault is faster, and the Unchecked.defaultof<> cannot
  
negative.code: // Stop monitoring. This disposes the event session, so will stop receiving
  // events for all running azmon processes on this machine. Further, you
  // will not collect events in the session until you call start again.
  let stop (session: Session) =
      let r = session.Trace.Stop(noThrow = true)
      session.Trace.Dispose()
      r