Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/armon/go-hlld
Golang client for HyperLogLog daemon (hlld)
https://github.com/armon/go-hlld
Last synced: 19 days ago
JSON representation
Golang client for HyperLogLog daemon (hlld)
- Host: GitHub
- URL: https://github.com/armon/go-hlld
- Owner: armon
- License: mit
- Created: 2016-01-19T04:13:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-31T01:14:31.000Z (almost 9 years ago)
- Last Synced: 2024-08-02T14:08:36.935Z (4 months ago)
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 21
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-hlld
Provides the `hlld` package that implements a client library for the
[HyperLogLog daemon](https://github.com/armon/hlld) (HLLD). HyperLogLogs provide
an extremely efficient method of cardinality estimation. The client library
supports pipelining for extremely high throughput.Documentation
=============The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-hlld).
Example
=======Below is a simple example of usage
```go
// Create a client
client, err := hlld.Dial("hlld-server:1234")
if err != nil {
panic("could not dial")
}// Create a new set, custom precision
createCommand, err := hlld.NewCreateCommand("foo")
if err != nil {
panic("failed to make command")
}// Start the command
future, err := client.Execute(createCommand)
if err != nil {
panic("failed to make command")
}// Wait for the command to finish
if err := future.Error(); err != nil {
panic("command failed")
}// Check the result
ok, err := createCommand.Result()
if !ok || err != nil {
panic("failed to make set")
}
```