Skip to content

Instantly share code, notes, and snippets.

View quiiver's full-sized avatar

wil stuckey quiiver

  • mozilla
  • bentonville, ar
View GitHub Profile
@quiiver
quiiver / ElasticsearchSource.scala
Created May 5, 2014 17:38
Scalding source for Elasticsearch
package com.twitter.scalding.sources
import cascading.tuple.Fields
import cascading.tap.Tap;
import org.elasticsearch.hadoop.cascading.EsTap
import com.twitter.scalding._
abstract class ElasticsearchSource extends Source {
@quiiver
quiiver / client.go
Created July 15, 2014 17:28
Hot reloadable tcp client in go
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
"os/signal"
#!/bin/bash
top=$(mktemp)
tmp1=$(mktemp)
tmp2=$(mktemp)
i=1
while [[ $(jq 'keys | length' $top) -lt 5000 ]]; do
echo iteration $i - $(jq 'keys | length' $top)
This file has been truncated, but you can view the full file.
{
"Main_Page": {
"2022/03/15": {
"views": 2411822,
"rank": 1
},
"2022/03/14": {
"views": 2622773,
"rank": 1
},
import os, json
from fastapi import FastAPI
app = FastAPI()
SUGGEST_FILES_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../data/")
SUGGESTIONS = {}
RESULTS = {}
@app.on_event("startup")
import os, json
from fastapi import FastAPI
app = FastAPI()
SUGGEST_FILES_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../data/")
SUGGESTIONS = {}
RESULTS = {}
@app.on_event("startup")
import time
from math import log2, log
from typing import Any, Dict
# Code copied from here
# https://github.com/wikimedia/mediawiki-extensions-CirrusSearch/blob/85572945a8f97829ac9c9a2c95bb97a40c24ac73/includes/BuildDocument/Completion/QualityScore.php
class Scorer():
➜ merino-explorations git:(main) ✗ k6 run --vus 5 --duration 10m -e HOST=local ./load-tests/test.js
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: ./load-tests/test.js
import http from "k6/http";
import { SharedArray } from 'k6/data';
export const options = {
scenarios: {
warmup: {
executor: 'ramping-arrival-rate',
preAllocatedVUs: 200,
timeUnit: '1s',
startRate: 0,
import http from "k6/http";
import { SharedArray } from 'k6/data';
export const options = {
scenarios: {
warmup: {
executor: 'ramping-arrival-rate',
preAllocatedVUs: 200,
timeUnit: '1s',
startRate: 0,