public FindDropletResponse(Guid argID, Instance argInstance, TimeSpan argUptime)
 {
     Dea            = argID;
     Version        = argInstance.Version;
     Droplet        = argInstance.DropletID;
     InstanceID     = argInstance.InstanceID;
     Index          = argInstance.InstanceIndex;
     State          = argInstance.State;
     StateTimestamp = argInstance.StateTimestamp;
     Staged         = argInstance.Staged;
     Stats          = new Stats(argInstance, argUptime);
 }
Esempio n. 2
0
        private void ProcessDropletStatus(string message, string reply)
        {
            if (shutting_down)
            {
                return;
            }

            log.Debug(Resources.Agent_ProcessDropletStatus_Fmt, message, reply);

            dropletManager.ForAllInstances((instance) =>
            {
                if (instance.CanGatherStats)
                {
                    var response = new Stats(instance); // TODO more statistics
                    natsClient.Publish(reply, response);
                }
            });
        }
Esempio n. 3
0
        private void ProcessDropletStatus(string message, string reply)
        {
            if (shutting_down)
            {
                return;
            }

            log.Debug(Resources.Agent_ProcessDropletStatus_Fmt, message, reply);

            dropletManager.ForAllInstances((instance) =>
            {
                if (instance.IsStarting || instance.IsRunning)
                {
                    var startDate = DateTime.ParseExact(instance.Start, Constants.JsonDateFormat, CultureInfo.InvariantCulture);
                    var span = DateTime.Now - startDate;
                    var response = new Stats(instance, span)
                    {
                        //Usage = 20
                    };
                    messagingProvider.Publish(reply, response);
                }
            });
        }