If you ever find yourself to have to go through old prometheus tsdb files, this is a quick guide on how to do so.
- Dump the tsdb data to a text file:
prometheus tsdb dump <path_to_prometheus_data_dir> > dump.txt- List all metric names in the dump:
If you ever find yourself to have to go through old prometheus tsdb files, this is a quick guide on how to do so.
prometheus tsdb dump <path_to_prometheus_data_dir> > dump.txt| #!/usr/bin/env python3 | |
| import argparse | |
| from sipyco import pc_rpc, common_args | |
| from driver import Camera | |
| def get_argparser(): |
| import spcm | |
| import math | |
| from spcm import units | |
| import numpy as np | |
| size = 100 | |
| f0 = np.linspace(85.0e6, 121.0e6, size) | |
| f1 = np.linspace(84.5e6, 120.5e6, size) |
| import spcm | |
| import numpy as np | |
| # Define frequency ranges for each channel | |
| ch0_freqs = np.linspace(85.0e6, 121.0e6, 3) | |
| ch1_freqs = np.linspace(84.5e6, 120.5e6, 3) | |
| # Assign cores to each channel | |
| ch0_cores = np.concatenate((np.arange(0, 8), np.arange(12, 20))) | |
| ch1_cores = np.concatenate((np.arange(8, 12), [20])) |
| import os | |
| import spcm | |
| import logging | |
| import time | |
| import argparse | |
| import numpy as np | |
| from itertools import chain | |
| from functools import reduce | |
| loglevel = os.getenv("LOGLEVEL", "WARNING").upper() |
| import spcm | |
| from spcm import units | |
| import numpy as np | |
| config = { | |
| # 18925: { | |
| # "path": "/dev/spcm0", | |
| # "freq": np.linspace(84.5, 120.5, 3), | |
| # "freq": [(120.5+84.5)/2] | |
| # }, |
| FROM nixos/nix:2.21.2 | |
| RUN mkdir -p /root/.config/nix | |
| COPY nix.conf /root/.config/nix | |
| WORKDIR /app | |
| COPY flake.nix . | |
| RUN nix develop . |
| package main | |
| import ( | |
| "log" | |
| "net" | |
| "net/http" | |
| "os" | |
| "github.com/prometheus/client_golang/prometheus" | |
| "github.com/prometheus/client_golang/prometheus/promhttp" |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/http" | |
| ) |
| from telnetlib import Telnet | |
| class PTC10: | |
| def __init__(self, host: str, port=None): | |
| self.host = host | |
| self.port = port | |
| def oven_power(self): | |
| with Telnet(self.host, self.port) as conn: |