private InstanceHistoryBuilder GetInstanceHistoryBuilder(ulong instanceId)
 {
     if (this.instanceBuilders.TryGetValue(instanceId, out InstanceHistoryBuilder builder))
     {
         return(builder);
     }
     else
     {
         var newBuilder = InstanceHistoryBuilder.ForDeletedInstance(instanceId);
         this.instanceBuilders[instanceId] = newBuilder;
         return(newBuilder);
     }
 }
 public void AddExistingInstance(
     ulong instanceId,
     VmInstanceReference reference,
     GlobalResourceReference image,
     InstanceState state,
     DateTime lastSeen,
     Tenancy tenancy)
 {
     this.instanceBuilders[instanceId] = InstanceHistoryBuilder.ForExistingInstance(
         instanceId,
         reference,
         image,
         state,
         lastSeen,
         tenancy);
 }