trafficmonitor init...2
This commit is contained in:
parent
a821014573
commit
9922a58114
@ -25,12 +25,16 @@ class Collector extends CommonController
|
|||||||
}
|
}
|
||||||
public function execute(): void
|
public function execute(): void
|
||||||
{
|
{
|
||||||
$trafficService = service('trafficservice');
|
try {
|
||||||
foreach ($trafficService->getEntities(['status' => STATUS['AVAILABLE']]) as $trafficEntity) {
|
$trafficService = service('trafficservice');
|
||||||
$data = $this->service->getCalculatedData($trafficEntity);
|
foreach ($trafficService->getEntities(['status' => STATUS['AVAILABLE']]) as $trafficEntity) {
|
||||||
// Collector DB에 결과 저장
|
$data = $this->service->getCalculatedData($trafficEntity);
|
||||||
$entity = $this->service->create($this->createDTO($data));
|
// Collector DB에 결과 저장
|
||||||
log_message('info', "트래픽 계산 및 저장 완료 (UID: {$trafficEntity->getPK()}), In: {$entity->getIn()} Kb/s / Out: {$entity->getOut()} Kb/s");
|
$entity = $this->service->create($this->createDTO($data));
|
||||||
|
log_message('info', "트래픽 계산 및 저장 완료 (UID: {$trafficEntity->getPK()}), In: {$entity->getIn()} Kb/s / Out: {$entity->getOut()} Kb/s");
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
log_message('info', "트래픽 계산 및 저장 실패:{$e->getMessage()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user