Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Conflicts: whisper/whisper.go
- Loading branch information
Showing
5 changed files
with
255 additions
and
86 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,6 +1,15 @@ | ||
**WARNING** This library is still under development and largely untested. Do not attempt to use with production data. | ||
|
||
whisper-go | ||
========== | ||
|
||
whisper-go is a library and set of utilities for working with the whisper database format used by the graphite project: https://github.com/graphite-project/ | ||
[![Build Status](https://drone.io/github.com/kisielk/whisper-go/status.png)](https://drone.io/github.com/kisielk/whisper-go/latest) | ||
|
||
whisper-go is a library and set of utilities for working with the whisper database format used by the graphite project: | ||
https://github.com/graphite-project/ | ||
|
||
Note that it is still in development so the API is subject to change. | ||
|
||
Note that it is still in development so the API is subject to change, and it may corrupt your data at any moment. Use with caution. | ||
API Documentation | ||
----------------- | ||
API documentation can be found at http://godoc.org/github.com/kisielk/whisper-go/whisper |
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"github.com/kisielk/whisper-go/whisper" | ||
"os" | ||
) | ||
|
||
func main() { | ||
flag.Parse() | ||
filename := flag.Arg(0) | ||
if filename == "" { | ||
flag.Usage() | ||
os.Exit(1) | ||
} | ||
|
||
db, err := whisper.Open(filename) | ||
if err != nil { | ||
fmt.Println("could not open database:", err) | ||
os.Exit(1) | ||
} | ||
defer db.Close() | ||
dumpHeader(db) | ||
dumpArchiveHeaders(db) | ||
} | ||
|
||
func dumpHeader(w *whisper.Whisper) { | ||
fmt.Println("Meta data:") | ||
fmt.Println(" aggregation method:", w.Header.Metadata.AggregationMethod) | ||
fmt.Println(" max retention:", w.Header.Metadata.MaxRetention) | ||
fmt.Println(" xFilesFactor:", w.Header.Metadata.XFilesFactor) | ||
fmt.Println() | ||
} | ||
|
||
func dumpArchiveHeaders(w *whisper.Whisper) { | ||
for i, archive := range w.Header.Archives { | ||
fmt.Println("Archive", i, "info:") | ||
fmt.Println(" offset:", archive.Offset) | ||
fmt.Println(" seconds per point", archive.SecondsPerPoint) | ||
fmt.Println(" points", archive.Points) | ||
fmt.Println(" retention", archive.Retention()) | ||
fmt.Println() | ||
} | ||
} |
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
Oops, something went wrong.