Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dist
*.tmp
*.dat
*.idx
*.csv
zig-watch*

# local env files
Expand Down
5 changes: 3 additions & 2 deletions billions.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const std = @import("std");
const Codspeed = @import("codspeed");
const tsm = @import("src/tsm/tsm.zig");

const TsmTree = tsm.TsmTreeImpl(1000, 4096, .gorilla);
const TsmTree = tsm.TsmTreeRuntime;

const metric_name = "bench.cpu.total.billions";
const hosts = [_][]const u8{
"h-0", "h-1", "h-2", "h-3", "h-4",
Expand Down Expand Up @@ -37,7 +38,7 @@ fn runBenchmark(allocator: std.mem.Allocator) !void {

var max_memory_bytes: u64 = 0;

var tree = try TsmTree.init(allocator, metric_name);
var tree = try TsmTree.init(allocator, metric_name, .Native);
defer tree.deinit();

const start = std.time.nanoTimestamp();
Expand Down
14 changes: 13 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,27 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
});

const codspeed = b.dependency("codspeed", .{
.target = target,
.optimize = benchmark_optimize,
});

const nats = b.dependency("nats", .{
.target = target,
.optimize = optimize,
});

const toml = b.dependency("toml", .{
.target = target,
.optimize = optimize,
});

exe.root_module.addImport("zio", zio.module("zio"));
exe.root_module.addImport("dusty", dusty.module("dusty"));
exe.root_module.addImport("zware", zware.module("zware"));

exe.root_module.addImport("nats", nats.module("nats"));
exe.root_module.addImport("toml", toml.module("toml"));
b.installArtifact(exe);

const run_step = b.step("run", "Run the app");
Expand Down
16 changes: 12 additions & 4 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
// internet connectivity.
.dependencies = .{
.zio = .{
.url = "git+https://github.com/lalinsky/zio?ref=v0.8.1#d091a8e4ed5849e1eb1bd4a49fd019e48f00546d",
.hash = "zio-0.8.1-xHbVVGpjGADhmfXLbPcE9zPS0rTlCM3s5Z7EPX4chiwx",
.url = "git+https://github.com/lalinsky/zio?ref=v0.8.2#3ac234eae165177cd75742f922851dc5d373fd12",
.hash = "zio-0.8.2-xHbVVC5jGAAYUMZd_BW5eT-HJb_lf-LCGj4PaLOeEkA2",
},
.dusty = .{
.url = "git+https://github.com/lalinsky/dusty#eeaa9a38464b617ee59836bec77820fcc103eb63",
.hash = "dusty-0.0.0-Qdw7RjF_CQDBCV9L-GJlIOJHa7I6rGmp1mKfqV61ocuL",
.url = "git+https://github.com/lalinsky/dusty#7f18e52557fd4748cde9e73a7c4a8a9c7d9b4bb7",
.hash = "dusty-0.0.0-Qdw7RgD0CQCYDLh3FuSf3cIMmvhqpIhDiH6MlNH1DJsA",
},
.zware = .{
.url = "git+https://github.com/slunghq/zware#be0d934ed01e59fd48859b14c7074d50c0e98d22",
Expand All @@ -49,6 +49,14 @@
.url = "git+https://github.com/james-elicx/codspeed-zig#00066158cab242c572368de69db9c58a548e8eb4",
.hash = "codspeed-0.0.1-Km8V_DhfBwDNpIj5PHSrZqekEjeVLhrLRUUYjXNsCGXJ",
},
.nats = .{
.url = "git+https://github.com/lalinsky/nats.zig#c7eb72dbdbf5e71c453c22b66a29356d0e6d2ad4",
.hash = "nats-0.0.0-JvIiUNy6BgBkOmLvuY1cfhjJLPg7CoFGRg6c91XteVqQ",
},
.toml = .{
.url = "git+https://github.com/notxorand/zig-toml#cf50bd59c6276fb2b6d34b8d71d35486eecc719c",
.hash = "toml-0.3.0-bV14Bd-EAQBKoXhpYft303BtA2vgLNlxntUCIWgRUl46",
},
},
.paths = .{
"build.zig",
Expand Down
51 changes: 51 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name = "basic"
lang = "rust"

[ingest]
method = ["websocket", "nats"]

[ingest.websocket]
method = "native"
port = 2077

[ingest.http]
port = 2078

[ingest.nats]
subscriptions = ["slung"]
url = "nats://localhost:4222"

[ingest.mqtt]
topics = ["slung"]
url = "mqtt://localhost:1883"

[flush]
method = "native"

[sync]
method = "s3"

[sync.s3]
bucket = "slung"

[sync.r2]
bucket = "slung"

[sync.socket]
port = 2080

[populate]
method = ["csv", "tdms", "native"]

[populate.csv]
path = ["/tmp/data.csv"]

[populate.tdms]
path = ["/tmp/data.tdms"]

[populate.native]
path = ["/tmp/_data.dat"]

[tree]
page_size = 4096
max_level = 100_000
5 changes: 3 additions & 2 deletions millions.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const std = @import("std");
const Codspeed = @import("codspeed");
const tsm = @import("src/tsm/tsm.zig");

const TsmTree = tsm.TsmTreeImpl(1000, 4096, .gorilla);
const TsmTree = tsm.TsmTreeRuntime;

const metric_name = "bench.cpu.total.millions";
const hosts = [_][]const u8{
"h-0", "h-1", "h-2", "h-3", "h-4",
Expand Down Expand Up @@ -37,7 +38,7 @@ fn runBenchmark(allocator: std.mem.Allocator) !void {

var max_memory_bytes: u64 = 0;

var tree = try TsmTree.init(allocator, metric_name);
var tree = try TsmTree.init(allocator, metric_name, .Native);
defer tree.deinit();

const start = std.time.nanoTimestamp();
Expand Down
Loading