diff --git a/AZ.Compute.Agent/Node.cs b/AZ.Compute.Agent/Node.cs index dd26d2b..b090eb6 100644 --- a/AZ.Compute.Agent/Node.cs +++ b/AZ.Compute.Agent/Node.cs @@ -23,6 +23,8 @@ namespace AZ.Compute.Agent NetworkInterface nic; ulong totalNetworkBytes; + const double nicSpeed = 10 * 1024 * 1024; // 10 MBps + [Export] string id; [Export] string ip; @@ -103,7 +105,9 @@ namespace AZ.Compute.Agent var ntb = (ulong)nic.GetIPv4Statistics().BytesReceived + (ulong)nic.GetIPv4Statistics().BytesSent; - network = (float)(((ntb - totalNetworkBytes) / 5.0) / nic.Speed); + network = (float)(((ntb - totalNetworkBytes) / 5.0) / nicSpeed); + + totalNetworkBytes = ntb; Cpu = cpuCounter.NextValue(); Ram = ramCounter.NextValue(); diff --git a/AZ.Compute/Service.cs b/AZ.Compute/Service.cs index 7ff6301..d5b23c0 100644 --- a/AZ.Compute/Service.cs +++ b/AZ.Compute/Service.cs @@ -26,6 +26,14 @@ namespace AZ.Compute [Export] public void Compute(string fileName, string arguments) { + if (fileName.Contains(" ")) + { + var sc = fileName.Split(' ', 2); + fileName = sc[0]; + arguments = sc[1]; + } + + // هنا ينحط الكود مال الغورثمية الي تستنكي افضل ايجينت حتى تشغل التاسك عليه //Agents.First().Compute(fileName, arguments); diff --git a/AZ.Compute/Web/index.html b/AZ.Compute/Web/index.html index 5a61aec..4b40076 100644 --- a/AZ.Compute/Web/index.html +++ b/AZ.Compute/Web/index.html @@ -57,7 +57,7 @@
- + diff --git a/AZ.Compute/Web/js/app.js b/AZ.Compute/Web/js/app.js index f97824e..3b0d04b 100644 --- a/AZ.Compute/Web/js/app.js +++ b/AZ.Compute/Web/js/app.js @@ -29,6 +29,8 @@ async function addJob() { alert(ex); } } + + document.getElementById("list").update(); } async function addAgent() { @@ -41,6 +43,9 @@ async function addAgent() { alert(ex); } } + + document.getElementById("list").update(); + } const FORMAT_CONNECTION_STATUS = (x) => ["Offline", "Connecting...", "Online"][x];