Logs the state of the current node server to the console.
429132
function logNodeState() {
        if (brackets.app && brackets.app.getNodeState) {
            brackets.app.getNodeState(function (err, port) {
                if (err) {
                    console.log("[NodeDebugUtils] Node is in error state " + err);
                } else {
                    console.log("[NodeDebugUtils] Node is listening on port " + port);
                }
            });
        } else {
            console.error("[NodeDebugUtils] No brackets.app.getNodeState function. Maybe you're running the wrong shell?");
        }
    }
895616
function(nodemon) {
            nodemon.on('log', function(event) {
              console.log(event.colour);
            });

            // opens browser on initial server start
            nodemon.on('config:update', function() {
              // Delay before server listens on port
              setTimeout(function() {
                require('open')('http://localhost:8080');
              }, 1000);
            });

            // refreshes browser when server reboots
            nodemon.on('restart', function() {
              // Delay before server listens on port
              setTimeout(function() {
                require('fs').writeFileSync('.rebooted', 'rebooted');
              }, 3000);
            });
          }
940720
def main(options):
    """"""
        
    client = Client(server=options.server, username=options.username, password=options.password)
    print('Successfully connected to %s' % client.server)
    print(client.si.CurrentTime())
    
    client.logout()
707124
ServerStatus getState() {
        final InternalState requiredState = this.requiredState;
        final InternalState state = internalState;
        if(requiredState == InternalState.FAILED) {
            return ServerStatus.FAILED;
        }
        switch (state) {
            case STOPPED:
                return ServerStatus.STOPPED;
            case SERVER_STARTED:
                return  ServerStatus.STARTED;
            default: {
                if(requiredState == InternalState.SERVER_STARTED) {
                    return ServerStatus.STARTING;
                } else {
                    return ServerStatus.STOPPING;
                }
            }
        }
    }
543446
function ServerState() {

  // server configuration
  this._conf = new Configuration();
  this._conf.once('load', this.onConfigLoad.bind(this));

  // the server bind address information
  // if listen() is never called this is null
  this._addr = null;

  // timestamp for the last save of the rdb file
  this._lastsave = Date.now();

  // server logger
  this._logger = logger();

  // periodic scheduler
  this._scheduler = new Scheduler();

  // collection of connections
  this._conn = [];

  // master pattern matcher
  this._pattern = new Pattern();

  // the store - this is where the data lives
  this._store = new Store(this._conf);

  // ensure we have a database at index 0
  // the SELECT command will lazily create databases
  // on demand
  if(this._store.databases[0] === undefined) {
    this._store.getDatabase(0, {pattern: this._pattern});
  }

  // server statistics
  this._stats = new Stats(this);

  // server information
  this._info = new Info(this);

  // global pubsub state
  this._pubsub = new PubSub(this._stats);

  // slow log storage
  this._slowlog = new SlowLog(this._conf);

  function onSave(time, diff, version, file) {
    this._lastsave = Date.now();
    this.log.notice('db saved to disk: %s seconds (%s)', time, file)
  }
  Persistence.on('save', onSave.bind(this));

  process.on('debug', debug.bind(this));
  process.on('tick', expire.bind(this));
}
646461
def _main_loop(self):
        '''
        
        '''
        self.logger.debug("Processing messages")
        old_time = 0
        while True:
            self._process_messages()
            if self.settings['STATS_DUMP'] != 0:
                new_time = int(old_div(time.time(), self.settings['STATS_DUMP']))
                # only log every X seconds
                if new_time != old_time:
                    self._dump_stats()
                    old_time = new_time

            self._report_self()
            time.sleep(self.settings['SLEEP_TIME'])
1242916
def log_status (self, checked, in_progress, queue, duration, num_urls):
        """"""
        msg = _n("%2d thread active", "%2d threads active", in_progress) % \
          in_progress
        self.write(u"%s, " % msg)
        msg = _n("%5d link queued", "%5d links queued", queue) % queue
        self.write(u"%s, " % msg)
        msg = _n("%4d link", "%4d links", checked) % checked
        self.write(u"%s" % msg)
        msg = _n("%3d URL", "%3d URLs", num_urls) % num_urls
        self.write(u" in %s checked, " % msg)
        msg = _("runtime %s") % strformat.strduration_long(duration)
        self.writeln(msg)
        self.flush()
1332360
def get_service_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime):
        
        # If our node is acknowledged or in downtime, state is ok/up
        if problem_has_been_acknowledged or in_scheduled_downtime:
            state = 0

        # Maybe we are a NOT node, so manage this
        if self.not_value:
            # Critical -> OK
            if state == 2:
                return 0
            # OK -> CRITICAL (warning is untouched)
            if state == 0:
                return 2
        return state
526265
def start(self):
        """"""
        msg = ''
        if not self.running():
            if self._port == 0:
                self._port = _port_not_in_use()
            self._process = start_server_background(self._port)
        else:
            msg = 'Server already started\n'
        msg += 'Server running at {}'.format(self.url())
        print(msg)
1370106
protected void startServerImpl() {
        SelendroidLogger.info("*** ServerInstrumentation#startServerImpl() ***");
        if (serverThread != null && serverThread.isAlive()) {
            return;
        }

        if (serverThread != null) {
            stopServer();
        }

        serverThread = new HttpdThread(this, serverPort);
        serverThread.startServer();
    }
1271069
function(log) { // log, data, native
    if (self.client) postCallback.apply(null, arguments);
    else queue.push(arguments);
  }
1322018
def node_state(id_):
    '''
    
    '''
    states_int = {
        0: 'RUNNING',
        1: 'REBOOTING',
        2: 'TERMINATED',
        3: 'PENDING',
        4: 'UNKNOWN',
        5: 'STOPPED',
        6: 'SUSPENDED',
        7: 'ERROR',
        8: 'PAUSED'}
    states_str = {
        'running': 'RUNNING',
        'rebooting': 'REBOOTING',
        'starting': 'STARTING',
        'terminated': 'TERMINATED',
        'pending': 'PENDING',
        'unknown': 'UNKNOWN',
        'stopping': 'STOPPING',
        'stopped': 'STOPPED',
        'suspended': 'SUSPENDED',
        'error': 'ERROR',
        'paused': 'PAUSED',
        'reconfiguring': 'RECONFIGURING'
    }
    return states_str[id_] if isinstance(id_, six.string_types) else states_int[id_]
837151
def output_callback(self, line, kill_switch):
        """"""
        self.notifications += line + "\n"

        if "Initialization Sequence Completed" in line:
            self.started = True
        if "ERROR:" in line or "Cannot resolve host address:" in line:
            self.error = True
        if "process exiting" in line:
            self.stopped = True
310163
function() {
  EventEmitter.call(this);
  this.httpServer = new HttpServer();

  var self = this;
  this.wsServer = new WebSocketServer({server: this.httpServer});

  this.wsServer.on('connection', function(socket) {
    // emit socket to outside
    self.emit('connection', socket);
  });

  this.state = ST_STARTED;
}
1217082
void logPoolState(String... prefix)
   {
      if (logger.isDebugEnabled()) {
         logger.debug("{} - {}stats (total={}, active={}, idle={}, waiting={})",
                      poolName, (prefix.length > 0 ? prefix[0] : ""),
                      getTotalConnections(), getActiveConnections(), getIdleConnections(), getThreadsAwaitingConnection());
      }
   }
174171
def show_progress(self):
        """'"""
        if self.in_progress_hanging:
            sys.stdout.write('.')
            sys.stdout.flush()
869496
def handle_status(self):
        """"""
        status = self.get_status()

        if status:
            # Update main-zone
            self.zones['main'].update_status(status)