• Stars
    star
    606
  • Rank 73,958 (Top 2 %)
  • Language
    JavaScript
  • License
    The Unlicense
  • Created almost 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ฌ A JavaScript interpretation of the Ruby library Scientist, a library for carefully refactoring critical paths.

scientist.js

๐Ÿ”ฌ A JavaScript interpretation of the Ruby library Scientist, a library for carefully refactoring critical paths.

Build Status Coverage Status

Install

npm install scientist.js

How do I science?

Let's pretend you're changing the way you handle permissions in a large web app. Tests can help guide your refactoring, but you really want to capture the current and refactored behaviours under load.

ES6 Sample

import {Experiment, Result} from 'scientist.js';

import Permission from './permission';
import Model from './model';

class MyWidget {
    constructor() {
        this.model = new Model();
    }

    allows(user) {
        var experiment = new Experiment("widget-permissions");
        experiment.use(() => this.model.checkUser(user).valid); // old way
        experiment.try(() => user.can(Permission.Read, this.model)); // new way

        return experiment.run();
    }
}

Use use(..) to wrap the existing original behaviour, and use try(..) to wrap the new behaviour. experiment.run(); will always return the result of the use block, but it does a bunch of stuff behind the scenes:

  • It decides whether or not to run the try block
  • Randomises order to execute try and use blocks
  • Measures the duration of both behaviours
  • Swallows (but records) any exceptions raised in the try block and
  • Set a condition to filter calls to try

Upcoming features (these already exist in the Ruby library):

  • Compares the result of try to the result of use,
  • Publishes all this information.

The use block is called the control. The try block is called the candidate.

More Repositories

1

FireSharp

An asynchronous cross-platform .Net library for Firebase
C#
695
star
2

design-patterns-and-idioms-in-es6

Design patterns and idioms in JS(ES6) /w traceur
HTML
341
star
3

vscode-open-in-github

Extension for Visual Studio Code which can be used to jump to a source code line in Github, Bitbucket, GitLab and Visualstudio.com
JavaScript
193
star
4

rdash-angular2

RDash admin dashboard theme /w AngularJS2 & TypeScript
HTML
182
star
5

InfluxDB.Net

Cross-platform .NET library for InfluxDB distributed time-series database.
C#
165
star
6

pyley

Python package for an open-source graph database Cayley
Python
159
star
7

hapijs-status-monitor

๐Ÿš€ Realtime Monitoring solution for Hapi.js apps
JavaScript
137
star
8

Caliburn.Metro

A library that combines MahApps.Metro with Caliburn.Micro for Metro UI styled WPF applications.
C#
110
star
9

socket.io-python-emitter

Python implementation of socket.io-emitter that provides a hook point to easily allow you to emit events to browsers from anywhere ๐Ÿš€
Python
74
star
10

reducio

โฑ ๐Ÿ‡ URL shortener service is written in Scala using Akka-Http and Redis โฐ
Scala
69
star
11

natura

A simple, efficient spring animation library for smooth, natural motion in Rust
Rust
67
star
12

Disque.Net

.Net library for the Disque distributed, in-memory message broker (i.e Redis as a job queue)
C#
56
star
13

Autofac.Extras.NLog

An Autofac module to integrate Autofac and NLog, it supports both constructor and property injection.
C#
50
star
14

Httwrap

General purpose, simple but useful HttpClient wrapper for .NET & Xamarin/Mono
C#
45
star
15

distrox

A fast thread-safe in-memory cache (storage) library and server that supports a big number of entries in Go
Go
37
star
16

angular-es6-webpack-boilerplate

AngularJS 1.4x and ES6 application boilerplate /w testing practices using Webpack
JavaScript
36
star
17

socket.io-go-emitter

Go implementation of socket.io-emitter
Go
24
star
18

AspNetWebApi-OutputCache-Redis

Redis cache for AspNetWebApi-OutputCache
C#
22
star
19

AspNet.Mvc.Theming

Enables implementing themes for ASP.NET MVC.
C#
21
star
20

Helmet

Middlewares to help secure your apps
C#
19
star
21

ProceXSS

ProceXSS is an Asp.NET Http module -tries- to prevent to xss attacks.
C#
15
star
22

neurolog

Go inteface to access `neural-redis`
Go
12
star
23

ioredis-eventemitter

Redis pubsub using an event emitter via ioredis Redis client for Node.js
JavaScript
11
star
24

consulr

Decode Consul KV data into JSON in Node.js and watch for updates
JavaScript
11
star
25

FunnyBus

Simple event aggregator/messenger for .net applications.
C#
10
star
26

Owin.Security.RedisTokenProviders

A RefreshTokenProvider using Redis as token store for Microsoft.Owin
C#
10
star
27

Panteon.Sdk

A distributed scheduled real-time task processing server for .NET
C#
10
star
28

atom-open-conemu-here

Adds a shortcut to Tree View - Open ConEmu Here in the context menu
CoffeeScript
9
star
29

redisetup

Redis setup scripts
Shell
9
star
30

k8splunk

Send kubernetes logs to splunk using fluentd
Smarty
8
star
31

Sentiment

Sentiment analysis using VADER in Scala
Scala
8
star
32

Reserveon

Sample reactive Movie Ticket reservation system written in Scala on akka-http with slick, postgres and redis
Scala
8
star
33

rock-paper-scissors-extended-java

Rock, Paper, Scissors game implementation with additional weapons support.
Java
7
star
34

Panteon.Host

A distributed scheduled real-time task processing server for .NET built on Schyntax, cs-schtick.redis and Redis for locking.
C#
6
star
35

csharp-trampolining-tail-call

C# implement trampolin to tail recursion
C#
6
star
36

arf

Powerful math lib for Vector, Matrix and Quaternion operations
Rust
5
star
37

node-procexss

Middleware to help to prevent xss attacks in your Express/Connect apps
JavaScript
5
star
38

panteon-dashboard

Panteon Web UI
JavaScript
5
star
39

Peximet

Akka cluster sample on Kubernetes
Scala
3
star
40

scream-processing

Playground for Apache Kafka, Apache Flink (CEP & ML), Elasticsearch, Kibana in Scala /w Testing practices
3
star
41

Common.Testing.NUnit

Provides base class with generic methods for testing
C#
3
star
42

AspNet.Mvc.ConfigurationExporter

Makes server side configurations are available on client side
C#
3
star
43

cerebro

Finding The Median In Large Sets Of Numbers Split Across N Servers using zeromq and nodejs (experimental)
JavaScript
3
star
44

bugthesystem

2
star
45

utopia

๐Ÿš€ โ‡ด ยตtopia
C++
2
star
46

socket.io-rabbitmq

socket.io adapter rabbitmq implementation
JavaScript
2
star
47

wasm-emc2

๐Ÿš€ C++ Webassembly experiments using Emscripten
C++
2
star
48

statsy

๐Ÿ”ฅ Calculates the median and average of large stream of data using count sort
JavaScript
2
star
49

pmecs

Poor man's Entity Component System
Rust
2
star
50

socket.io-rabbitmq-emitter

socket.io emitter implementation
JavaScript
2
star
51

dataloader

DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
Scala
2
star
52

Exncod

Exncod - fast url encode
C#
2
star
53

Panteon.Realtime.Pusher

Add real-time functionalities to tasks and dashboard using Pusher
C#
2
star
54

rock-paper-scissors-extended-nodejs

Rock, Paper, Scissors game implementation with additional weapons support.
JavaScript
2
star
55

docker-containers

come in!
Puppet
1
star
56

socket.io-rabbitmq-server

socket.io pub-sub server rabbitmq implementation
JavaScript
1
star
57

skala-vert.x

Vert.x sample using scala
Scala
1
star
58

HandyEx

Small handy extensions in C#
C#
1
star
59

Panteon.HistoryStorage

Panteon history storage implementations (sql server, mongodb etc)
C#
1
star
60

autopoco.js

Simple test data creator
JavaScript
1
star
61

ymal

Little command line utility for modifiying YAML files
JavaScript
1
star
62

hodor

An Authorization server based on "Zanzibar: Googleโ€™s Consistent, Global Authorization System"
1
star
63

Transformer

Poor man's mapping library - its not AUTO.
C#
1
star
64

polygon-utils

Ray-casting algorithm to determine if point is inside a polygon
Scala
1
star
65

polylabel

A fast algorithm for finding the pole of inaccessibility of a polygon
Scala
1
star