-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
# Pure PHP RRDtool file reader | ||
|
||
> Because on windows php ext-rrd can not read rrd files created on unix. | ||
> Because on windows php ext-rrd can not read rrd files created on unix and vice versa. | ||
> See https://github.com/oetiker/rrdtool-1.x/issues/759 | ||
**Only meant to export data out of rrd file. Not support for consolidation function etc** | ||
This library supports reading: | ||
* rrds created on 64bit linux from 64bit Windows | ||
* rrds created on 64bit Windows from 64bit Linux | ||
|
||
**Only meant to export/dump data out of rrd file. No support for consolidation function etc** | ||
|
||
Original repository: http://javascriptrrd.sourceforge.net/ | ||
|
||
## Example | ||
|
||
``` | ||
use RrdPhpReader\RrdReader; | ||
$reader = RrdReader::createFromPath('path/to/my_rrd.rrd'); | ||
$data = $reader->setDs('value')->setRraIndex(0)->getAsArray(); | ||
``` | ||
``` | ||
|
||
`$data` structure would be | ||
``` | ||
[ | ||
'value' => [ <--- datasource as first level keys | ||
0 => [ <--- rra index as key | ||
1521054891 => 6, <--- timestamp => value | ||
1521054892 => 7, | ||
1521054893 => 8, | ||
1521054894 => 9, | ||
] | ||
] | ||
]; | ||
``` |