| 84 | | # FIXME: shouldn't need to add the epoch line back in manually |
|---|
| 85 | | local $/; # slurp the rest of the file |
|---|
| 86 | | return "timestamp $epoch\n" . <$fh>; |
|---|
| | 84 | # The timestamp isn't part of the multigraph protocol, |
|---|
| | 85 | # just part of spoolfetch, so we have to filter it out, |
|---|
| | 86 | # and replace each value line with its current value |
|---|
| | 87 | my $data = ""; |
|---|
| | 88 | while(<$fh>) { |
|---|
| | 89 | chomp; |
|---|
| | 90 | if (m/^timestamp (\d+)/) { |
|---|
| | 91 | # epoch is updated |
|---|
| | 92 | $epoch = $1; |
|---|
| | 93 | next; |
|---|
| | 94 | } |
|---|
| | 95 | |
|---|
| | 96 | if (m/^(\w+)\.value (?:N:)?([0-9.]+)$/) { |
|---|
| | 97 | $_ = "$1.value $epoch:$2"; |
|---|
| | 98 | } |
|---|
| | 99 | |
|---|
| | 100 | $data .= $_ . "\n"; |
|---|
| | 101 | } |
|---|
| | 102 | |
|---|
| | 103 | return $data; |
|---|