第一版 Send-Heartbeat 加入branch_name 來得知那間店的

20250522
This commit is contained in:
allen.yan 2025-05-22 14:49:19 +08:00
parent 1896202376
commit 047b85baa7

View File

@ -59,6 +59,7 @@ function Get-Token {
function Send-Heartbeat($token, $ip) { function Send-Heartbeat($token, $ip) {
while ($true) { while ($true) {
$heartbeat = @{ $heartbeat = @{
branch_name = $branchName
hostname = $env:COMPUTERNAME hostname = $env:COMPUTERNAME
ip = $ip ip = $ip
cpu = [math]::Round((Get-Counter '\Processor(_Total)\% Processor Time').CounterSamples.CookedValue, 2) cpu = [math]::Round((Get-Counter '\Processor(_Total)\% Processor Time').CounterSamples.CookedValue, 2)