Programming

Unit Testing Emscripten Library in Browser Using CMake and Nightwatch.JS

Unit Testing Emscripten Library in Browser Using CMake and Nightwatch.JS

In a previous blog post, I described how I took Emscripten-created JS and turned it into an UMD module. One of the reasons I did this was because I wanted more control over the generated JavaScript and for it to be usable in more contexts, such as with the RequireJS module loader. As I am a responsible developer, I desired to create a number of automated unit tests to ensure that the client-visible API for my Emscripten module works as I intended.
Creating UMD Module from Emscripten using CMake

Creating UMD Module from Emscripten using CMake

By default, Emscripten creates a module which can be used from both Node.JS and the browser, but it has the following issues: The module pollutes the global namespace The module is created with the name Module (in my case, I require streamingPercentiles) The module cannot be loaded by some module loaders such as require.js While the above issues can (mostly) be corrected by using –s MODULARIZE=1, it changes the semantics of the resulting JavaScript file, as the module now returns a function rather than an object.
Calculating Percentiles on Streaming Data

Calculating Percentiles on Streaming Data

This is my calculating percentiles on streaming data post series Introduction Notes on Implementing Greenwald-Khanna Visualizing Greenwald-Khanna JavaScript Library C++ Library Building a C++ and JavaScript Library from a Single Codebase Cormode-Korn-Muthukrishnan-Srivastava
Visualizing Latency

Visualizing Latency

This is my visualizing latency post series Introduction What is Binning? Rendering Event Data Official D3 Latency Heatmap Page
Visualizing Latency Part 4: Official D3 Latency Heatmap Page

Visualizing Latency Part 4: Official D3 Latency Heatmap Page

This post is part 4 of my series about visualizing latency, which is very useful for debugging certain classes of performance problems. Allow me to wrap up my visualizing latency post series by noting that my official D3 latency heatmap repository is at https://github.com/sengelha/d3-latency-heatmap/. Monitor this repository for future developments to the D3 latency heatmap chart.
Visualizing Latency Part 3: Rendering Event Data

Visualizing Latency Part 3: Rendering Event Data

This post is part 3 of my series about visualizing latency, which is very useful for debugging certain classes of performance problems. Now that I have introduced the D3 latency heatmap chart component and explained what binning is, I can discuss the primary use case of the chart: rendering event data. What is event data First, I must explain what I mean by event data. For a fuller treatment, please read Analytics For Hackers: How To Think About Event Data, but allow me to summarize: Event data describes actions performed by entities.
Visualizing Latency Part 2: What is Binning?

Visualizing Latency Part 2: What is Binning?

This post is part 2 of my series about visualizing latency, which is very useful for debugging certain classes of performance problems. As mentioned in Brendan Gregg’s Latency Heat Maps page, a latency heat map is a visualization where each column of data is a histogram of the observations for that time interval. Using Brendan Gregg’s visualization: As with histograms, the key decision that needs to be made when using a latency heat map is how to bin the data.
Visualizing Latency Part 1: Introduction

Visualizing Latency Part 1: Introduction

This post is part 1 of my series about visualizing latency, which is very useful for debugging certain classes of performance problems. A latency heatmap is a particularly useful tool for visualizing latency. For a great treatment of latency heatmaps, please read Brendan Gregg’s Latency Heat Maps page and the ACM Queue article Visualizing System Latency. On the right, you can see a latency heatmap generated from a job queueing system which shows a number of interesting properties, not least of which is that the system appears to be getting slower over time.
Data-Driven Code Generation of Unit Tests Part 5: Closing Thoughts

Data-Driven Code Generation of Unit Tests Part 5: Closing Thoughts

This post is part 5 of my series about data-driven code generation of unit tests. In the previous posts in this series, I walked through the idea of performing data-driven code generation for unit tests, as well as how I implemented it in three different programming languages and build systems. This post contains some final thoughts about the effort. Was it worth it? Almost certainly. Although it required substantial up-front effort to set up the unit test generators, this approach found numerous, previously-undetected bugs both within my implementation of the calculation library as well as with legacy implementations.
Data-Driven Code Generation of Unit Tests Part 4: C#, MSBuild, T4, MS Unit Test

Data-Driven Code Generation of Unit Tests Part 4: C#, MSBuild, T4, MS Unit Test

This post is part 4 of my series about data-driven code generation of unit tests. This blog post explains how I used C#, MSBuild, T4 Text Templates, and the Microsoft Unit Test Framework for Managed Code to perform data-driven code generation of unit tests for a financial performance analytics library. If you haven’t read it already, I recommend starting with Part 1: Background. As mentioned in Part 2: C++, CMake, Jinja2, Boost, all performance analytics metadata is stored in a single file called metadata.