Esempio n. 1
0
 def _setup_config_collector(self):
     collector = NginxConfigCollector(object=self, interval=self.intervals['configs'])
     try:
         start_time = time.time()
         collector.collect()  # run parse on startup
     finally:
         end_time = time.time()
         context.log.debug(
             '%s config parse on startup in %.3f' % (self.definition_hash, end_time - start_time)
         )
     self.collectors.append(collector)
Esempio n. 2
0
 def _setup_config_collector(self):
     collector = NginxConfigCollector(object=self,
                                      interval=self.intervals['configs'])
     try:
         start_time = time.time()
         collector.collect()  # run parse on startup
     finally:
         end_time = time.time()
         context.log.debug('%s config parse on startup in %.3f' %
                           (self.definition_hash, end_time - start_time))
     self.collectors.append(collector)
Esempio n. 3
0
 def _restore_config_collector(self, previous):
     collector = NginxConfigCollector(object=self, interval=self.intervals['configs'], previous=previous)
     try:
         start_time = time.time()
         collector.collect(no_delay=True)  # run NginxConfigCollector.parse_config on object restart
     finally:
         end_time = time.time()
         context.log.debug(
             '%s restored previous config collector in %.3f' % (self.definition_hash, end_time - start_time)
         )
     self.collectors.append(collector)
Esempio n. 4
0
 def _restore_config_collector(self, previous):
     collector = NginxConfigCollector(object=self,
                                      interval=self.intervals['configs'],
                                      previous=previous)
     context.log.debug('%s restored previous config collector' %
                       self.definition_hash)
     self.collectors.append(collector)