blar/rrd Define a new RRD file $timestamp = new DateTimeImmutable('2016-01-01 13:37:42'); $creator = new RRDCreator(); $creator->setFileName($rrd->getFileName()); $creator->setStart($timestamp); $creator->setStep(60); Add data source for downstream $dataSource = new RrdDataSource(); $dataSource->setName('downstream'); $dataSource->setType(RrdDataSource::TYPE_COUNTER); $creator->addDataSource($dataSource); Add data source for upstream $dataSource = new RrdDataSource(); $dataSource->setName('upstream'); $dataSource->setType(RrdDataSource::TYPE_COUNTER); $creator->addDataSource($dataSource); Add archive $archive = new RrdArchive(); $archive->setConsolidation(RrdArchive::CONSOLIDATION_AVERAGE); $archive->setSteps(60); $archive->setRows(60 * 24); $creator->addArchive($archive); Save the new RRD file $creator->save(); Push data $rrd->update([ 'downstream' => 1024, 'upstream' => 768 ]); Get last update $rrd->getLastUpdate();