Skip to content

Instantly share code, notes, and snippets.

@EshaMaharishi
EshaMaharishi / plot_time_for.py
Created April 20, 2026 21:44
plot_time_for.py
#!/usr/bin/env python3
"""Plot safetyMonitored* call durations from viam-server log."""
import re
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
@EshaMaharishi
EshaMaharishi / plot_step_times.py
Created April 20, 2026 21:36
plot_step_times.py
#!/usr/bin/env python3
"""Plot per-step MoveThroughJointPositions call durations.
Usage: python3 plot_step_times.py [step_times.csv] [output.png]
"""
import csv
import sys
import matplotlib
matplotlib.use("Agg")
@EshaMaharishi
EshaMaharishi / move_through_joint_positions_loop.go
Last active April 20, 2026 21:41
move_through_joint_positions_loop.go
package main
import (
"context"
"crypto/tls"
"flag"
"fmt"
"os"
"time"
diff --git a/robot/session_web.go b/robot/session_web.go
index 8d6a3f919..ea0ef4f90 100644
--- a/robot/session_web.go
+++ b/robot/session_web.go
@@ -2,8 +2,10 @@ package robot
import (
"context"
+ "fmt"
"strings"
diff --git a/robot/session_web.go b/robot/session_web.go
index 8d6a3f919..ea0ef4f90 100644
--- a/robot/session_web.go
+++ b/robot/session_web.go
@@ -2,8 +2,10 @@ package robot
import (
"context"
+ "fmt"
"strings"
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index ec8835979cc..aa83986c473 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -419,9 +419,10 @@ buildvariants:
- name: .stitch
- name: secondary_reads_passthrough_gen
- name: server_discovery_and_monitoring_json_test_TG
- - name: .serverless !.multiversion
- distros:
Script:
```
const st = new ShardingTest({shards: {rs0: {nodes: 2}}, config: 1, other: { mongosOptions: {verbose: 3}}});
for (let i = 0; i < 1000; i++) {
st.s.getDB("test").foo.insert({_id: i});
}
let cursor = st.s.getDB("test").foo.find().readPref('secondary');
@EshaMaharishi
EshaMaharishi / debugging_mongodb_gdb.md
Last active April 17, 2023 06:41
Debugging MongoDB with GDB

Debugging MongoDB with gdb

gdb is a command line tool that you can use to examine the state of a (1) terminated or (2) running C or C++ process.

Background: Debugging a terminated process

A process can terminate (uncleanly) for a few reasons, such as triggering a segmentation fault, failing an invariant, or throwing an uncaught exception.

A binary can be compiled so that when a process terminates (uncleanly), the process produces a core dump, which is a file containing a "frozen" record of the state of all threads that existed in the process at the time it terminated.

@EshaMaharishi
EshaMaharishi / decorations_mongodb.md
Last active October 1, 2024 12:45
Decorations in MongoDB

The Decorator Pattern

A Decoration is an object that is stored as part of another object, called the Decorable.

The lifetime of the Decoration is tied to the lifetime of the Decorable. This means the Decoration is constructed when the Decorable's constructor is called, and the Decoration is destructed when the Decorable's destructor is called.

Finally, the decoration can only be accessed through the decorable.

The Decorator pattern is an easy way to add parts to an existing object without changing the object.