Code Monkey home page Code Monkey logo

good-udp's Introduction

good-udp

Udp broadcasting for Good process monitor

Build Status Current Version

Lead Maintainer: Ulrik Augustsson

Usage

good-udp is a good-reporter implementation to write hapi server events to remote endpoints. It sends a request with a JSON payload to the supplied endpoint.

Note

good-udp will never close the udp client.

Good Udp

GoodUdp (events, config)

creates a new GoodUdp object with the following arguments

  • events - an object of key value pairs. - key - one of the supported good events indicating the hapi event to subscribe to - value - a single string or an array of strings to filter incoming events. "*" indicates no filtering. null and undefined are assumed to be "*"

  • config - configuration object

    • endpoint - full path to remote server to transmit logs.
    • [threshold] - number of events to hold before transmission. Defaults to 20. Set to 0 to have every event start transmission instantly. It is strongly suggested to have a set threshold to make data transmission more efficient.
    • [udpType] - a string with the type of udp you want to use. Valid options are udp4 or udp6. Defaults to 'udp4'.

    Good Udp Methods

    goodudp.init(stream, emitter, callback)

    Initializes the reporter with the following arguments:

    • stream - a Node readable stream that will be the source of data for this reporter. It is assumed that stream is in objectMode.
    • emitter - an event emitter object.
    • callback - a callback to execute when the start function has complete all the necessary set up steps and is ready to receive data.

    When stream emits an "end" event, goodudp will transmit any events remaining it it's internal buffer to attempt to prevent data loss.

Schema

Each request will match the following schema. Every event will be wrapped inside the events key and grouped by the event type and ordered by the timestamp. The payload that is sent to the endpoint has the following schema:

{
	"host":"servername.home",
	"schema":"good-udp",
	"timeStamp":1412710565121,
	"events":{
		"request":[
			{
				"event":"request",
				"timestamp":1413464014739,
				...
			},
			{
				"event":"request",
				"timestamp":1414221317758,
				...
			},
			{
				"event":"request",
				"timestamp":1415088216608,
				...
			}
		],
		"log":[
			{
				"event":"log",
				"timestamp":1415180913160,
				...
			},
			{
				"event":"log",
				"timestamp":1422493874390,
				...
			}
		]
	}
}

good-udp's People

Contributors

arb avatar briandela avatar chmanie avatar cjihrig avatar fhemberger avatar lloydbenson avatar sericaia avatar ulrikstrid avatar

Stargazers

 avatar

Watchers

 avatar  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.