question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trackers: add stress-testing modules

See original GitHub issue

To facilitate stress-testing for trackers we can add modules providing boilerplate code for each tracker allowing us to:

  • check how long does it take to send big queue of events
  • check if there’s any errors happening due sending big volumes of events
  • compare performance of trackers

Though, I don’t see it as unit-test, but rather as manual approach with manual deployment of collector.

Here’s Node.js example:

// npm install node-uuid

// Random generator
var uuid = require('node-uuid');

// Initialization
var snowplow = require('snowplow-tracker');
var emitter = snowplow.emitter;
var tracker = snowplow.tracker;
var errors = [],
    successes = [],
    unknowns = [];

// Sent event counter
var sentEventCounter = 0;


function trackCallback(error, body, response) { // Callback called for each request
    sentEventCounter++;
    if (error) {
        errors.push({'error': error, 'sentEventCounter': sentEventCounter});
    } else if (body.statusCode === 200){
        successes.push(sentEventCounter);
    } else {
        unknowns.push({
            'error': error,
            'body': body,
            'response': response,
            'sentEventCounter': sentEventCounter
        });
    }
}

var e = emitter('collectorUri', 'http', 80, 'POST', 0, cb);
var t = tracker([e], 'myTracker', 'myApp', false);

// Getters
function getSuccesses() { return successes; }
function getErrors() { return errors; }
function getUnknowns() { return unknowns; }

function generateEvent() {
    var rnd = uuid.v4();
    var pageView = {
        'pageUrl': 'http://example.com/' + rnd,
        'pageTitle': rnd,
        'referrer': rnd
    };
    t.trackPageView(pageView.pageUrl, pageView.pageTitle, pageView.referrer);
}

function start() {
    for (var i = 0; i < 10000; i++) {
        generateEvent();
    }
}

module.exports = { 
    generateOneEvent: generateEvent, 
    getErrors: getErrors, 
    getSuccesses: getSuccesses, 
    getUnknowns: getUnknowns, 
    start: start 
};

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
chuwycommented, Oct 18, 2017

Hey QA-workgroup (@alexanderdean @BenFradet @jbeemster @ihortom)!

TL;DR I propose a TSV file format that trackers can read to get events and then we can compare Redshift content and these files.

I implemented small PoC of “QuickCheck for Snowplow” in Scala Tracker. It basically consist of:

  1. Random event generator
  2. Logic to save objects to TSV files with format similar to following:pv chuwy.me/page.html Main page http://google.com ttm:12312313253 where first pv refers to page view and subsequent columns are just tracking functions argument. Having that most of our trackers use same positional argument, I believe this should be quite ubiquitous
  3. Logic to create emitter and tracker, read these TSV files and flood collector with these events from TSV.

What do I propose here? As I said we can re-use this format to see if there’s any data-loss on Tracker -> Collector part of pipeline, compare tracker’s performance and discover problems.

0reactions
alexanderdeancommented, Apr 28, 2021

Move to general tracker (protocol) repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Best Load Testing Tools For Web Applications In 2022
LoadRunner is a software testing tool that measures system behavior and performance under complex load and stress scenarios.
Read more >
Top 12 load testing tools for web applications in 2022
Load testing is a critical aspect of application and web development. Here is an overview of the top load testing tools for web...
Read more >
Updating PVEL's PV Module Product Qualification Program
Tracker -mounted mechanical stress testing. Our new, optional add-on protocol for the mechanical stress sequence utilizes a tracker mounting ...
Read more >
Top Load Testing Tools: The Best Tools for Load ... - Stackify
Loader.io offers simple cloud-based load testing for stress testing your web apps and APIs with thousands of concurrent connections. Check out ...
Read more >
Top 20 Best Test Management Tools (New 2023 Rankings)
It integrates seamlessly with the leading bug tracking tools like JIRA, ... Fully modular test management: Create, import, add or track ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found