Skip to content

Instantly share code, notes, and snippets.

@bushidocodes
Last active April 26, 2017 23:24
Show Gist options
  • Save bushidocodes/0ac62a6775eeb7ba92ad47651f66c9aa to your computer and use it in GitHub Desktop.
Save bushidocodes/0ac62a6775eeb7ba92ad47651f66c9aa to your computer and use it in GitHub Desktop.
Notes from Capital Go Conf

Evolution of Go Loggers

  • Summer 2014 - inconshreveable/log15
  • Fall 2014 - go-stack/stack
  • Spring 2015 - go-kit/kit/log
  • Summer 2015 - go-logfmt/logfmt

json logfmt

**go-kit/kit/log

single function

Check out the excellent list of related microservice and web frameworks at https://gokit.io/

type Logger interface {
  Log(keyvals ...interface{}) err
}

use of alternating key/value pairs

func Run Task(task Task, logger log.Logger) {
logger.Log("taskID", task.ID, "event", "starting task")
logger.Log("taskID", task.ID, "event", "task complete")
}

Uses standard lib to generate JSON.

Contextual Loggers

With WithPrefix

Dynamic Context Value Useful for timestamps

Log Levels...

Read up more on gokit.io

Logging versus Instrumentation https://peter.bourgon.org/blog/2016/02/07/logging-v-instrumentation.html

Sidebar on JS Transducers https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624

Finite State Transducers

Finite State Automata -> same as Finite state

RegExes and Finite State Automata are equivalent

Ordered ranges of key/value pairs

By defining the order of states, the data can be memory mapped and use byte slice offsets in place of pointers

I would presume that this might allow exploitation of FPGAs or GPU type accelerators

serialization of history of finite states... allowing time travel

Isn't this just a trie????

vellum

https://github.com/couchbaselabs/vellum

levenshtein edit distance - fuzzy matching

FSTs actually might compress data

Key feature is trying to improve access efficiency

"Index 1,600,000,000 keys with automata and rust"

https://pdfs.semanticscholar.org/5ab9/3f378554e1c19d1ceb34ca5f5b4b4803ed22.pdf

https://www.manning.com/books/go-in-action

Guaranteed delivery versus unknown latency

The only reason that you might want to have a buffer > 1 is if you have done some serious measurement / investigation into the performance characteristics of the receiver.

Fan-out pattern... this might justify a buffered channel

Document the measurements and data behind the sizing of channels if you are anything larger than 1.

Signalling w/o data on stat change

go bla bla close(v)

<-v


Profile all the things

CPU Goroutine Heap Thread

Serves up basic metrics ----> net/http/pprof <-------

https://golang.org/pkg/runtime/pprof/

------ Testing with Docker talk ---------

GoConvey WebUI

mirror project path into the gopath in the cotainer. ... via docker

The site for this project is a pretty good example of marketing to developers.. http://goconvey.co/

https://gist.github.com/arowla/bff5fbb3aa79ed5a0abedda8c39bfca0

https://changelog.com/gotime

http://pachyderm.io/

Links to check out:

https://github.com/go-kit/kit https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624 https://golang.org/pkg/net/http/pprof/

https://github.com/potocnyj/presentations http://goconvey.co/ https://gist.github.com/arowla/bff5fbb3aa79ed5a0abedda8c39bfca0 http://gobuffalo.io/docs/getting-started https://revel.github.io/ https://changelog.com/gotime https://machinebox.io/ http://pachyderm.io/ http://www.datadan.io/containerized-data-science-and-engineering-part-2-dockerized-data-science/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment