From 27b6c418467319d5dd3bded0b3ae5789b576c71d Mon Sep 17 00:00:00 2001 From: Yoshihiro OKUMURA Date: Thu, 14 Oct 2021 14:20:54 +0900 Subject: [PATCH] fixed bug to create database. --- lib/Rrd/Temperature.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Rrd/Temperature.php b/lib/Rrd/Temperature.php index c97a9ea..7fcb470 100644 --- a/lib/Rrd/Temperature.php +++ b/lib/Rrd/Temperature.php @@ -50,7 +50,7 @@ class Temperature { $fpath = $this->getFilePath($id); if (!file_exists($fpath)) { - if (!$this->_createDatabase($fpath)) { + if (!$this->create($id)) { return false; } } @@ -106,12 +106,12 @@ class Temperature * * @return bool false if failure */ - private function create(string $id): boolean + private function create(string $id): bool { $fpath = $this->getFilePath($id); $options = [ '--step', '60', // 1min step - sprintf('DS:%s:GAUGE:600:0:100', $this->id), // 10min hartbeat + sprintf('DS:%s:GAUGE:600:0:100', $id), // 10min hartbeat 'RRA:LAST:0.5:1:1440', // last/m - 1day(1440min) 'RRA:LAST:0.5:30:52560', // last/30m - 3years(365day=30min*17520)*3 ];