Ejemplo n.º 1
0
 /// <summary>
 /// Creates resource detail and inserts it into the manifest.
 /// </summary>
 /// <param name="resources">The resources.</param>
 /// <param name="manifest">The manifest.</param>
 internal override void AddToManifest(Collection <VirtualResource> resources, SystemManifest manifest)
 {
     // Iterate through each resource and create the manifest for the PerfMon Collector process.
     foreach (VirtualResource resource in resources)
     {
         PerfMonCollectorDetail detail = manifest.Resources.GetResource <PerfMonCollectorDetail>(resource.VirtualResourceId);
         if (detail == null)
         {
             detail = CreateDetail(resource);
             manifest.Resources.Add(detail);
         }
     }
 }
Ejemplo n.º 2
0
        private PerfMonCollectorDetail CreateDetail(VirtualResource resource)
        {
            PerfMonCollector collector = resource as PerfMonCollector;

            PerfMonCollectorDetail detail = new PerfMonCollectorDetail
            {
                ResourceId    = collector.VirtualResourceId,
                ResourceType  = EnumUtil.Parse <VirtualResourceType>(collector.ResourceType),
                Name          = collector.Name,
                Description   = collector.Description,
                InstanceCount = collector.InstanceCount,
                Platform      = collector.Platform,
                Enabled       = collector.Enabled,
                HostName      = collector.HostName
            };

            CreateMetadataDetail(resource, detail);
            return(detail);
        }