neo-utils-go

command module
v0.0.0-...-3ac8d09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2016 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

neo-utils-go

Neo4j Utils in Go.

Provides a wrapper for neoism.Database to output the database url in the String() method.

Provides and EnsureIndexes function that will take a map of label/property pairs, and an IndexManager (normally this will be a neoism.Database) and checks whether those indexes exist. If not, they are created.

Batch Cypher Runner

Currently supports batch running of queries.

import "github.com/Financial-Times/neo-cypher-runner-go"

Create a batch cypher runner like this:

cypherRunner := neocypherrunner.NewBatchCypherRunner(db, maxBatchSize)

Execute a batch of queries like this:

cypherRunner.CypherBatch([]*neoism.CypherQuery{query})
Metrics

There are three metrics that this library will capture, using go-metrics:

  • batchQueueSize: a gauge which keeps track of the number of queued requests, i.e. waiting to be written to Neo4j
  • batchThroughput: a meter keeping track of queries processed, with throughput over several time periods
  • execute-neo4j-batch: a timer measuring how long each batch or queries takes to run against neo4j

To use the metrics, set up metrics in your application, for example to output to graphite.ft.com:

addr, _ := net.ResolveTCPAddr("tcp", graphiteTCPAddress)
	go graphite.Graphite(metrics.DefaultRegistry, 1*time.Minute, graphitePrefix, addr) 

where, for example:

  • graphiteTCPAddress is for graphite.ft.com:2003
  • and graphitePrefix is unique for your service, e.g. content.[env].people.rw.neo4j.[hostname] - you should probably set this from environment-specific configuration, e.g. hiera data

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL