Giter Site home page Giter Site logo

xm-labs-dummy-event-generator's Introduction

Dummy Event Generator

This is a utility for generating some random event data. This was built for dumping data into Splunk, but could be used for any application.

Pre-Requisites

Files

  • Generator.js - The shared library for generating dummy events

Installation

Details of the installation go here.

xMatters set up

  1. Log in to your xMatters instance as a user with the Developer role (or anyone with access to the target communication plan). On the Developer tab, click Edit > Integration Builder for the target communication plan.
  2. Expand the Shared libraries section (if necessary) and click the + Add button
  3. Update the name at the top from My Shared Library to DataGenerator, then paste in the contents of the Generator.js file and hit Save.

Using the Generator

In a Integration Builder script, add all or some of the following code, depending on if you need corresponding active and terminated event pairs

var Generator = require( 'Generator' );

// Get the base event template
var activeEvent = Generator.getActiveEventBase();
var termEvent   = Generator.getTerminatedEventBase();

// Generate a "fake" GUID. 
var eventID     = Generator.generateBadGUID();

// Get some random event and recipient data
var eventData = Generator.getSampleEventData();
var recipData = Generator.getSampleRecipient();
var resolvedRecipData = Generator.getResolvedRecipients();

// Overwrite elements in Base Event
activeEvent = Generator.mergeRecursive( activeEvent, eventData );
activeEvent.recipients = recipData;
activeEvent.id = eventID;

// Ditto for terminated event
termEvent = Generator.mergeRecursive( termEvent, eventData );
termEvent.recipients.data = activeEvent.recipients.data.concat( resolvedRecipData );
termEvent.recipients.count = termEvent.recipients.data.length;
termEvent.recipients.total = termEvent.recipients.data.length;
termEvent.id = eventID;

Testing

Testing will depend on what you are doing with the data and how the script is triggered.

xm-labs-dummy-event-generator's People

Contributors

xmtinkerer avatar

Watchers

 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.