Skip to content

Instantly share code, notes, and snippets.

View eriksywu's full-sized avatar

Erik Wu eriksywu

  • Chronosphere
View GitHub Profile
@eriksywu
eriksywu / downsampler.MD
Last active November 17, 2025 04:41
a general, somewhat-formal proof cumulative downsampler correctness

Objective

Find a mapping $DS$ (cumulative downsampler) such that $$DS : {X} \longrightarrow {Y} \times {R}, \quad where \quad {X} = \mathbb{R}^N, \quad {Y} = \mathbb{R}^M, \quad M \le N,\quad N \gt 1, \quad M \gt 1 \quad \text{and} \quad M \text{ is a cost to minimize.}$$

$DS$ has these constraints:

  1. $\exists {m} in {M} \text{such that } Increase(X) = Increase(D(X)) ; \text{for all } x \in X$
    • The increase observed in the input and output must be equal
  2. $\forall x \in X, ; y = DS(x) ; => y_1 = x_1 ; and ; y_m = x_n$

Objective

Prove that there exists a mapping $DS$ (cumulative downsampler) such that $$DS : {X} \longrightarrow {Y}, \quad where \quad {X} = \mathbb{R_{\ge 0}}^N, \quad {Y} = \mathbb{R_{\ge 0}}^M, \quad M \le N,\quad N \gt 1, \quad M \gt 1 \quad \text{and} \quad M \text{ is a cost to minimize.}$$

$DS$ has these constraints:

  1. $\exists {m} \in M, \text{ such that } Increase(X) = Increase(D(X)) ; \text{for all } x \in X$
    • The increase observed in the input and output must be equal
  2. $\forall x \in X, \quad y = DS(x) \quad => y_1 = x_1 \quad and \quad y_m = x_n$
@eriksywu
eriksywu / gist:d3a5b66848efe78125bebd5ceb134fa2
Created August 13, 2025 22:38
otelcol yaml with `metricstarttime` processor using start_time_attribute
apiVersion: apps/v1
kind: Deployment
metadata:
name: otelcollector-deployment
spec:
replicas: 1
selector:
matchLabels:
app: otelcollector-deployment
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: promtest
labels:
app: promtest
spec:
replicas: 1
selector:
matchLabels:
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: downgradecontainerd
namespace: kube-system
labels:
app: downgradecontainerd
spec:
selector:
matchLabels:
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: downgradecontainerd
namespace: kube-system
labels:
app: downgradecontainerd
spec:
selector:
matchLabels:
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: ensure-no-dup
namespace: kube-system
labels:
app: ensure-no-dup
spec:
selector:
matchLabels:
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: snat-exemption
namespace: kube-system
labels:
app: snat-exemption
spec:
selector:
matchLabels:
apiVersion: v1
kind: Pod
metadata:
name: busybox1
labels:
app: busybox1
spec:
containers:
- image: busybox
command:
@eriksywu
eriksywu / linux_no_cas_no_cpa.json
Last active April 16, 2020 16:24
manual_scaling
{
"apiVersion": "vlabs",
"location": "",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.17",
"kubernetesConfig": {
"components": [{
"name": "kube-addon-manager",