Skip to documentation
SLOP

tiny.profiling.json

Reference tiny.profiling json

Defined in tiny.profiling.

API (9)

Actions

Public operations.

No direct callersNo direct callstiny.profilingjson
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Called byCallsNo direct callsprivate sourcelib.preserves.src.jsonwriteArrayanalyze.loadparseCapturesanalyze.renderexpectRepeatedMeasurementJsontest; no linksrc.profiling.analyze.testtest: profiling analysis summarizes a...capture.cozload+22 morejsonarray
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate; no linksrc.profiling.analyze.loadparseGitprivate; no linksrc.profiling.analyze.loadretainWorkloadIdentityperturbationparseMeasurementprivate; no linksrc.profiling.reductiondomainBoolprivate; no linksrc.profiling.report.analysisparseComparisonSupport+2 morejsonasBool
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsanalyze.loadparseWorkloadprivate; no linksrc.profiling.analyze.loadresourceValuetest; no linksrc.profiling.analyze.testtest: profiling analysis summarizes a...private; no linksrc.profiling.capture.cozparseResultexperiment.parseparse+19 morejsonasF64
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsiteration.batchloaditeration.batchmarkerAtprivate; no linksrc.profiling.iteration.batchparseTestReceiptprivate; no linksrc.profiling.report.modelloadManifestjsonasI128
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsanalyze.loadparseWorkloadtest; no linksrc.profiling.jsontest: profiling json helpers read num...private; no linksrc.profiling.measurementparseExecutionGroupprivate; no linksrc.profiling.perturbationparseResultprivate; no linksrc.profiling.scenarioparseOraclejsonasI64
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsallocation.Totalsrecordprivate; no linksrc.profiling.allocationresizeGrowthprivate; no linksrc.profiling.analyze.loadartifactCountanalyze.loadloadRunprivate; no linksrc.profiling.analyze.loadparseAcquisition+46 morejsonasU64
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsprivate sourcelib.preserves.src.jsonwriteDictionaryprivate sourcelib.preserves.src.jsonwriteJsonprivate sourcelib.preserves.src.jsonwriteRecordtest; no linksrc.profiling.allocationtest: profiling allocation totals sum...analyze.loadloadRun+92 morejsonobject
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsjsonstringsjsonstring
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsanalyze.loadloadRunprivate; no linksrc.profiling.analyze.loadretainWorkloadIdentitytest; no linksrc.profiling.jsontest: profiling json helpers read num...private; no linksrc.profiling.orderparseStringsprivate; no linksrc.profiling.report.analysisparseOrderEffectsjsonarrayjsonstringjsonstrings
Static calls · unresolved targets: 1 · external targets: 1.

Source: src/profiling/json.zig

zig
const std = @import("std");pub fn object(value: std.json.Value) !std.json.ObjectMap {    return switch (value) {        .object => |actual| actual,        else => error.InvalidProfilingJson,    };}pub fn array(value: std.json.Value) !std.json.Array {    return switch (value) {        .array => |actual| actual,        else => error.InvalidProfilingJson,    };}pub fn string(value: ?std.json.Value) ?[]const u8 {    return switch (value orelse return null) {        .string => |actual| actual,        else => null,    };}pub fn asBool(value: ?std.json.Value) ?bool {    return switch (value orelse return null) {        .bool => |actual| actual,        else => null,    };}pub fn asU64(value: ?std.json.Value) ?u64 {    return switch (value orelse return null) {        .integer => |actual| if (actual < 0) null else @intCast(actual),        .float => |actual| if (actual < 0 or @floor(actual) != actual) null else @intFromFloat(actual),        .number_string => |actual| std.fmt.parseInt(u64, actual, 10) catch null,        else => null,    };}pub fn asI64(value: ?std.json.Value) ?i64 {    return switch (value orelse return null) {        .integer => |actual| @intCast(actual),        .float => |actual| if (@floor(actual) != actual) null else @intFromFloat(actual),        .number_string => |actual| std.fmt.parseInt(i64, actual, 10) catch null,        else => null,    };}pub fn asI128(value: ?std.json.Value) ?i128 {    return switch (value orelse return null) {        .integer => |actual| @intCast(actual),        .float => |actual| if (@floor(actual) != actual) null else @intFromFloat(actual),        .number_string => |actual| std.fmt.parseInt(i128, actual, 10) catch null,        else => null,    };}pub fn asF64(value: ?std.json.Value) ?f64 {    return switch (value orelse return null) {        .integer => |actual| @floatFromInt(actual),        .float => |actual| actual,        .number_string => |actual| std.fmt.parseFloat(f64, actual) catch null,        else => null,    };}pub fn strings(allocator: std.mem.Allocator, value: ?std.json.Value) ![]const []const u8 {    const actual = value orelse return &.{};    const items = try array(actual);    var result: std.ArrayList([]const u8) = .empty;    for (items.items) |item| {        if (string(item)) |text| try result.append(allocator, text);    }    return try result.toOwnedSlice(allocator);}test "profiling json helpers read numeric shapes" {    var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator);    defer arena_state.deinit();    const allocator = arena_state.allocator();    const value = try std.json.parseFromSliceLeaky(std.json.Value, allocator,        \\{"a":1,"b":2,"c":3.5,"d":["x"]}    , .{});    const root = try object(value);    try std.testing.expectEqual(@as(u64, 1), asU64(root.get("a")).?);    try std.testing.expectEqual(@as(i64, 2), asI64(root.get("b")).?);    try std.testing.expectEqual(@as(f64, 3.5), asF64(root.get("c")).?);    const values = try strings(allocator, root.get("d"));    try std.testing.expectEqualStrings("x", values[0]);}

Source: src/profiling/root.zig:30

zig
pub const json = @import("json.zig");

Complete caller list for json.array

27 direct callers.

Complete caller list for json.asBool

7 direct callers.

Complete caller list for json.asF64

24 direct callers.

Complete caller list for json.asU64

51 direct callers.

Complete caller list for json.object

97 direct callers.

Audit

Definitions10
Public names10
Members0
Version26.7.0
Revisiondaab053ee433