public CPUUsageMonitoringCommand(
     IMonitoringEnvironmentConfiguration environment,
     IMonitoringSourceConfiguration source)
 {
     Type        = MonitoringType.Website;
     Environment = environment.Name;
     Group       = source.Group;
     Source      = source.Name;
     Name        = source.Name;
     Connection  = source.ApplicationPool;
 }
 public DatabaseMonitoringCommand(
     IMonitoringEnvironmentConfiguration environment,
     IMonitoringSourceConfiguration source,
     IMonitoringDatabaseConfiguration database)
 {
     Type        = MonitoringType.Database;
     Environment = environment.Name;
     Group       = source.Group;
     Source      = source.Name;
     Name        = database.Name;
     Connection  = database.ConnectionString;
 }
        private Environment CreateEnvironment(
            IMonitoringEnvironmentConfiguration environment, IEnumerable <MonitoringResult> results)
        {
            var environmentModel = new Environment();

            environmentModel.Name = environment.Name;

            foreach (var sourceGroup in environment.Sources.ToLookup(s => s.Group))
            {
                var group = CreateGroup(sourceGroup,
                                        results.Where(result => result.Group.Equals(sourceGroup.Key, _comparisonType)).ToList());

                environmentModel.Groups.Add(group);
            }

            return(environmentModel);
        }