Code Monkey home page Code Monkey logo

bootic_data_collector's Introduction

Data collector

This is a realtime events/statistics recording and distribution backend written in Go. The backend is designed to receive messages via UDP and publish them via Websockets and a ZMQ pub/sub socket:

Incoming events/stats are broadcast out to any listening websocket clients.

Start

$ go run main.go --zmqsocket=tcp://:6000 --udphost=host:5555 --wshost=host:5555 --ssehost=localhost:5556 --accesstoken=foobar

Options

Option Description example
zmqsocket ZMQ socket to publish events to. tcp://6000
udphost UDP host:port to listen for incoming events on someserver:5555
wshost host:port for Websockets endpoint somepublicserver.com:80
ssehost host:port for Server Sent Events endpoint somepublicserver:5555
accesstoken Access token to authenticate public endpoints "foobar123"

Consumers

Consumer programs can subscribe to all or some event types on the ZMQ socket. Ruby example:

require 'zmq'
require 'msgpack'

context = ZMQ::Context.new
chans   = %w(order pageview)
sub     = context.socket ZMQ::SUB

sub.connect "tcp://127.0.0.1:6000"

chans.each { |ch| sub.setsockopt ZMQ::SUBSCRIBE, ch }

puts "Listening to events"

while line = sub.recv
  chan,  msg = line.split ' ', 2
  event = MessagePack.unpack(msg)
  puts "##{chan}: #{event['data']['account']} tz #{event['data']['tz']}"
end

bootic_data_collector's People

Contributors

ismasan avatar s6577t avatar

Watchers

Marcelle von Wendland avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.