mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 08:18:43 -06:00
add generate_visualizer_data
feature
This commit is contained in:
parent
09b0a0160b
commit
7bc81fc72a
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -11,3 +11,5 @@ target/
|
|||
|
||||
#old source
|
||||
_src
|
||||
|
||||
_visualizer.json
|
||||
|
|
26
Cargo.lock
generated
26
Cargo.lock
generated
|
@ -771,6 +771,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
dependencies = [
|
||||
"ahash 0.7.6",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -897,6 +898,12 @@ dependencies = [
|
|||
"windows-sys 0.45.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
|
||||
|
||||
[[package]]
|
||||
name = "jni-sys"
|
||||
version = "0.3.0"
|
||||
|
@ -935,6 +942,7 @@ dependencies = [
|
|||
"nohash-hasher",
|
||||
"postcard",
|
||||
"rayon",
|
||||
"serde_json",
|
||||
"shipyard",
|
||||
"strum",
|
||||
"uflow",
|
||||
|
@ -1611,6 +1619,12 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
|
||||
|
||||
[[package]]
|
||||
name = "safe_arch"
|
||||
version = "0.5.2"
|
||||
|
@ -1670,6 +1684,17 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.94"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_spanned"
|
||||
version = "0.6.1"
|
||||
|
@ -1718,6 +1743,7 @@ dependencies = [
|
|||
"hashbrown 0.12.3",
|
||||
"lock_api",
|
||||
"rayon",
|
||||
"serde",
|
||||
"shipyard_proc",
|
||||
]
|
||||
|
||||
|
|
|
@ -21,11 +21,13 @@ flume = "0.10"
|
|||
gilrs = { version = "0.10", default_features = false, features = ["xinput"] }
|
||||
uflow = "0.7"
|
||||
postcard = { version = "1.0", features = ["alloc"] }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
winapi = { version = "0.3" }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
generate_visualizer_data = ["serde_json", "shipyard/serde1"]
|
||||
parallel = ["shipyard/parallel"]
|
||||
nightly = ["glam/core-simd", "kubi-shared/nightly"]
|
||||
|
|
|
@ -187,6 +187,13 @@ fn main() {
|
|||
world.add_workload(render);
|
||||
world.add_workload(after_frame_end);
|
||||
|
||||
//Save _visualizer.json
|
||||
#[cfg(feature = "generate_visualizer_data")]
|
||||
std::fs::write(
|
||||
"_visualizer.json",
|
||||
serde_json::to_string(&world.workloads_type_usage()).unwrap(),
|
||||
).unwrap();
|
||||
|
||||
//Run startup systems
|
||||
world.run_workload(startup).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue