Skip to content

Instantly share code, notes, and snippets.

View breezewish's full-sized avatar

Wish breezewish

View GitHub Profile
@breezewish
breezewish / report.md
Created August 16, 2026 13:19
Run9 latest production warm host quick performance report — 2026-08-16

最新生产环境 Warm Host 快速性能报告

  • 测试日期:2026-08-16
  • 测试时段:21:05–22:16 JST
  • 生产入口:https://api.run.sys9.ai
  • Warm host 设置:1、5、10
  • 并发档位:每台 warm host 4 个和 6 个 worker
  • 连续负载时长:每组 30 秒
  • Workload:snap fork → box create → /bin/true
@breezewish
breezewish / report.md
Created July 24, 2026 14:21
Run9 production warm host capacity and latency report — 2026-07-24

生产环境 Warm Host 容量与延迟报告

  • 测试日期:2026-07-24
  • 测试时段:17:39–23:09 JST
  • 生产入口:https://api.run.sys9.ai
  • Warm host 设置:1、5、10、20
  • 并发档位:每台 warm host 4 个和 11 个并发 worker
  • 连续负载时长:每组 10 分钟
  • 测试 workload:snap fork → box create → exec
@breezewish
breezewish / left-code.go
Last active December 24, 2025 06:53
Auto retry on Cloudflare 400 / 524 errors
// Usage: go run left-code.go
// Configure: base_url = "http://127.0.0.1:1400/codex/v1"
package main
import (
"bytes"
"flag"
"fmt"
"io"
@breezewish
breezewish / grafana-export.js
Created August 18, 2020 14:53
Export current Grafana dashboard (for Grafana v6.x.x)
(function () {
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
#!/usr/bin/python
from __future__ import print_function
import argparse
import json
import os
import sys
def collect_mtime_list(path):
@breezewish
breezewish / simple-maco.rs
Created February 3, 2019 08:29
A simple procedural macro that generates a static metric for rust-prometheus.
extern crate proc_macro;
use quote::quote;
use proc_macro::TokenStream;
use syn::*;
use syn::parse::{Parse, ParseStream};
#[derive(Debug)]
struct MetricDefinition {
vis: Visibility,
@breezewish
breezewish / prometheus-sample.rs
Created February 2, 2019 13:09
A getting started example for rust-prometheus + hyper
#[macro_use]
extern crate lazy_static;
use hyper::rt::Future;
use hyper::service::service_fn_ok;
use hyper::{Body, Request, Response, Server};
use prometheus::*;
use rand::prelude::*;
lazy_static! {
@breezewish
breezewish / ast_vs_rpn.rs
Last active March 6, 2020 10:30
AST vs RPN evaluation performance. JavaScript version: https://gist.github.com/koorchik/9717b893ae2134e21dbe
//! AST vs RPN evaluation performance in Rust language.
#![feature(test)]
extern crate test;
#[derive(Clone, Copy, Debug)]
pub enum Function {
Plus,
Minus,
@breezewish
breezewish / protobufjs-stream-decoder.js
Last active January 9, 2024 04:27
Protobuf.js 6+ Stream Decoder
import through2 from 'through2';
import { BufferReader } from 'protobufjs';
function decodeProtobuf(decodeFunc, msgMaxSize = 20 * 1000 * 1000) {
const buffer = Buffer.alloc(msgMaxSize);
const reader = new BufferReader(buffer);
let bufferLen = 0; // The length of valid data in buffer, may contain multiple messages
reader.pos = 0;
@breezewish
breezewish / webgl_renderer.js
Created April 30, 2018 15:20
GPU Accelerated Image Rendering (RGBA in Uint8Array) using WebGL
(function () {
const VERTEX_SHADER = `
attribute vec4 a_position;
attribute vec2 a_texcoord;
varying vec2 v_texcoord;
void main() {
gl_Position = a_position;