up
This commit is contained in:
@ -23,6 +23,8 @@ namespace AZ.Compute.Agent
|
|||||||
NetworkInterface nic;
|
NetworkInterface nic;
|
||||||
ulong totalNetworkBytes;
|
ulong totalNetworkBytes;
|
||||||
|
|
||||||
|
const double nicSpeed = 10 * 1024 * 1024; // 10 MBps
|
||||||
|
|
||||||
|
|
||||||
[Export] string id;
|
[Export] string id;
|
||||||
[Export] string ip;
|
[Export] string ip;
|
||||||
@ -103,7 +105,9 @@ namespace AZ.Compute.Agent
|
|||||||
|
|
||||||
var ntb = (ulong)nic.GetIPv4Statistics().BytesReceived + (ulong)nic.GetIPv4Statistics().BytesSent;
|
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();
|
Cpu = cpuCounter.NextValue();
|
||||||
Ram = ramCounter.NextValue();
|
Ram = ramCounter.NextValue();
|
||||||
|
@ -26,6 +26,14 @@ namespace AZ.Compute
|
|||||||
[Export]
|
[Export]
|
||||||
public void Compute(string fileName, string arguments)
|
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);
|
//Agents.First().Compute(fileName, arguments);
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<div class="content" async:data="d?.get('sys/service')">
|
<div class="content" async:data="d?.get('sys/service')">
|
||||||
|
|
||||||
<i-repeat :data="d?.Agents">
|
<i-repeat :data="d?.Agents" id="list">
|
||||||
<table class="table-list">
|
<table class="table-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -29,6 +29,8 @@ async function addJob() {
|
|||||||
alert(ex);
|
alert(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.getElementById("list").update();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addAgent() {
|
async function addAgent() {
|
||||||
@ -41,6 +43,9 @@ async function addAgent() {
|
|||||||
alert(ex);
|
alert(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.getElementById("list").update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FORMAT_CONNECTION_STATUS = (x) => ["Offline", "Connecting...", "Online"][x];
|
const FORMAT_CONNECTION_STATUS = (x) => ["Offline", "Connecting...", "Online"][x];
|
||||||
|
Reference in New Issue
Block a user