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 @@