void UpdateValues() { if (incrementor == 0) { return; } timestampIndex += incrementor; HostMetrics metric = GetComponentInParent <HostMetrics>(); metric.UpdateNodes(incrementor); List <GameObject> hostGrid = metric.GetHostGrid(); string[] timestampComponents = metric.GetTimestamp(timestampIndex).Split('T'); GameObject.Find("TimestampText").GetComponent <Text>().text = timestampComponents[0] + "\n" + timestampComponents[1].Split('-')[0]; foreach (GameObject host in hostGrid) { float value = metric.GetIndividualValue(host.transform.name, timestampIndex); metric.UpdateHostColor(host, value); if (host.GetComponent <DetailHover>() != null) { if (metric.GetMetricType() == "Usage") { host.GetComponent <DetailHover>().updateDetail((Math.Round(value, 4) * 100).ToString() + "%"); } else { host.GetComponent <DetailHover>().updateDetail(value.ToString()); } } } }
public OfflineHost(Application application) : base(application, application.GetClientSettings()) { var parms = application.HostParameters; this.parameters = parms; this.tickTime = TimeSpan.FromMilliseconds((1f / this.parameters.TickRate) * 1000); this.tickCounter = new Counter(TimeSpan.FromSeconds(1)); this.metrics = new HostMetrics(); this.state = HostState.Constructed; this.dispatcher = new MemoryDispatcher(application); this.thread = new Thread(new ThreadStart(this.Run)); this.timer = new Stopwatch(); }
public NullHost(Application app) : base(app, app.GetClientSettings()) { this.emptyMetrics = new HostMetrics(); }