From 7d16879d6300fe9a6f1d74450d65b4d542ae7485 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 4 Feb 2018 18:38:38 -0500 Subject: [PATCH] Add prometheus to ofborg --- nix/ofborg-carnix.nix | 127 +++++++++++++++++++++++++++++++++++++++++- ofborg/Cargo.lock | 39 +++++++++++++ ofborg/Cargo.toml | 1 + 3 files changed, 165 insertions(+), 2 deletions(-) diff --git a/nix/ofborg-carnix.nix b/nix/ofborg-carnix.nix index de062a2..a27a016 100644 --- a/nix/ofborg-carnix.nix +++ b/nix/ofborg-carnix.nix @@ -210,6 +210,14 @@ rec { sha256 = "1xxbzd8cjlpzsb9fsih7mdnndhzrvykj0w77yg90qc85az1xwy5z"; inherit dependencies buildDependencies features; }; + fnv_1_0_6_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { + crateName = "fnv"; + version = "1.0.6"; + authors = [ "Alex Crichton " ]; + sha256 = "128mlh23y3gg6ag5h8iiqlcbl59smisdzraqy88ldrf75kbw27ip"; + libPath = "lib.rs"; + inherit dependencies buildDependencies features; + }; foreign_types_0_3_2_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { crateName = "foreign-types"; version = "0.3.2"; @@ -444,6 +452,28 @@ rec { sha256 = "06k8fxgrsrxj8mjpjcq1n7mn2p1shpxif4zg9y5h09c7vy20s146"; inherit dependencies buildDependencies features; }; + prometheus_0_3_11_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { + crateName = "prometheus"; + version = "0.3.11"; + authors = [ "overvenus@gmail.com" "siddontang@gmail.com" ]; + sha256 = "1c5vcy771cwpd14adgknf7pmf603p8nf4q90ik7ry083vxrvbmbg"; + inherit dependencies buildDependencies features; + }; + protobuf_1_4_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { + crateName = "protobuf"; + version = "1.4.3"; + authors = [ "Stepan Koltsov " ]; + sha256 = "093fczpx523lm6d7xr5d4mqs88891ay6wk951yck3cavsz35z00b"; + crateBin = [ { name = "protoc-gen-rust"; path = "protoc-gen-rust.rs"; } { name = "protobuf-bin-gen-rust-do-not-use"; path = "protobuf-bin-gen-rust-do-not-use.rs"; } ]; + inherit dependencies buildDependencies features; + }; + quick_error_0_2_2_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { + crateName = "quick-error"; + version = "0.2.2"; + authors = [ "Paul Colomiets " "Colin Kiegel " ]; + sha256 = "0r1f4ps998y779qwvnmmxhjq00qh5wxg3m5inswfawg0vr2732db"; + inherit dependencies buildDependencies features; + }; quote_0_3_15_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { crateName = "quote"; version = "0.3.15"; @@ -559,6 +589,13 @@ rec { sha256 = "1pcclssyndz54cncsizkqrblmqqr1p2g6xhkpwldbk6qc95m4yw3"; inherit dependencies buildDependencies features; }; + spin_0_4_6_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { + crateName = "spin"; + version = "0.4.6"; + authors = [ "Mathijs van de Nes " "John Ericson " ]; + sha256 = "1mp30r3pxb38m6mszcgn6136d1r162fwcidg3y4d9rym21hmialj"; + inherit dependencies buildDependencies features; + }; syn_0_11_11_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { crateName = "syn"; version = "0.11.11"; @@ -1025,6 +1062,10 @@ rec { (f.error_chain_0_10_0.default or false) || (error_chain_0_10_0.default or false); }) [ backtrace_0_3_5_features ]; + fnv_1_0_6 = { features?(fnv_1_0_6_features {}) }: fnv_1_0_6_ {}; + fnv_1_0_6_features = f: updateFeatures f (rec { + fnv_1_0_6.default = (f.fnv_1_0_6.default or true); + }) []; foreign_types_0_3_2 = { features?(foreign_types_0_3_2_features {}) }: foreign_types_0_3_2_ { dependencies = mapFeatures features ([ foreign_types_shared_0_1_1 ]); }; @@ -1324,7 +1365,7 @@ rec { num_cpus_1_8_0.default = (f.num_cpus_1_8_0.default or true); }) [ libc_0_2_36_features ]; ofborg_0_1_1 = { features?(ofborg_0_1_1_features {}) }: ofborg_0_1_1_ { - dependencies = mapFeatures features ([ amqp_0_1_0 env_logger_0_4_3 fs2_0_4_3 hubcaps_0_3_16 hyper_0_10_13 hyper_native_tls_0_2_4 log_0_3_8 lru_cache_0_1_1 md5_0_3_6 serde_1_0_27 serde_derive_1_0_27 serde_json_1_0_9 tempfile_2_2_0 uuid_0_4_0 ]); + dependencies = mapFeatures features ([ amqp_0_1_0 env_logger_0_4_3 fs2_0_4_3 hubcaps_0_3_16 hyper_0_10_13 hyper_native_tls_0_2_4 log_0_3_8 lru_cache_0_1_1 md5_0_3_6 prometheus_0_3_11 serde_1_0_27 serde_derive_1_0_27 serde_json_1_0_9 tempfile_2_2_0 uuid_0_4_0 ]); }; ofborg_0_1_1_features = f: updateFeatures f (rec { amqp_0_1_0.default = true; @@ -1337,13 +1378,14 @@ rec { lru_cache_0_1_1.default = true; md5_0_3_6.default = true; ofborg_0_1_1.default = (f.ofborg_0_1_1.default or true); + prometheus_0_3_11.default = true; serde_1_0_27.default = true; serde_derive_1_0_27.default = true; serde_json_1_0_9.default = true; tempfile_2_2_0.default = true; uuid_0_4_0.default = true; uuid_0_4_0.v4 = true; - }) [ amqp_0_1_0_features env_logger_0_4_3_features fs2_0_4_3_features hubcaps_0_3_16_features hyper_0_10_13_features hyper_native_tls_0_2_4_features log_0_3_8_features lru_cache_0_1_1_features md5_0_3_6_features serde_1_0_27_features serde_derive_1_0_27_features serde_json_1_0_9_features tempfile_2_2_0_features uuid_0_4_0_features ]; + }) [ amqp_0_1_0_features env_logger_0_4_3_features fs2_0_4_3_features hubcaps_0_3_16_features hyper_0_10_13_features hyper_native_tls_0_2_4_features log_0_3_8_features lru_cache_0_1_1_features md5_0_3_6_features prometheus_0_3_11_features serde_1_0_27_features serde_derive_1_0_27_features serde_json_1_0_9_features tempfile_2_2_0_features uuid_0_4_0_features ]; openssl_0_9_23 = { features?(openssl_0_9_23_features {}) }: openssl_0_9_23_ { dependencies = mapFeatures features ([ bitflags_0_9_1 foreign_types_0_3_2 lazy_static_1_0_0 libc_0_2_36 openssl_sys_0_9_24 ]); features = mkFeatures (features.openssl_0_9_23 or {}); @@ -1375,6 +1417,59 @@ rec { pkg_config_0_3_9_features = f: updateFeatures f (rec { pkg_config_0_3_9.default = (f.pkg_config_0_3_9.default or true); }) []; + prometheus_0_3_11 = { features?(prometheus_0_3_11_features {}) }: prometheus_0_3_11_ { + dependencies = mapFeatures features ([ cfg_if_0_1_2 fnv_1_0_6 lazy_static_0_2_11 protobuf_1_4_3 quick_error_0_2_2 spin_0_4_6 ]) + ++ (if kernel == "linux" then mapFeatures features ([]) else []); + features = mkFeatures (features.prometheus_0_3_11 or {}); + }; + prometheus_0_3_11_features = f: updateFeatures f (rec { + cfg_if_0_1_2.default = true; + fnv_1_0_6.default = true; + lazy_static_0_2_11.default = true; + prometheus_0_3_11.clippy = + (f.prometheus_0_3_11.clippy or false) || + (f.prometheus_0_3_11.dev or false) || + (prometheus_0_3_11.dev or false); + prometheus_0_3_11.default = (f.prometheus_0_3_11.default or true); + prometheus_0_3_11.hyper = + (f.prometheus_0_3_11.hyper or false) || + (f.prometheus_0_3_11.push or false) || + (prometheus_0_3_11.push or false); + prometheus_0_3_11.libc = + (f.prometheus_0_3_11.libc or false) || + (f.prometheus_0_3_11.nightly or false) || + (prometheus_0_3_11.nightly or false) || + (f.prometheus_0_3_11.process or false) || + (prometheus_0_3_11.process or false) || + (f.prometheus_0_3_11.push or false) || + (prometheus_0_3_11.push or false); + prometheus_0_3_11.procinfo = + (f.prometheus_0_3_11.procinfo or false) || + (f.prometheus_0_3_11.process or false) || + (prometheus_0_3_11.process or false); + protobuf_1_4_3.default = true; + quick_error_0_2_2.default = true; + spin_0_4_6.default = (f.spin_0_4_6.default or false); + spin_0_4_6.unstable = + (f.spin_0_4_6.unstable or false) || + (prometheus_0_3_11.nightly or false) || + (f.prometheus_0_3_11.nightly or false); + }) [ cfg_if_0_1_2_features fnv_1_0_6_features lazy_static_0_2_11_features protobuf_1_4_3_features quick_error_0_2_2_features spin_0_4_6_features ]; + protobuf_1_4_3 = { features?(protobuf_1_4_3_features {}) }: protobuf_1_4_3_ { + dependencies = mapFeatures features ([]); + features = mkFeatures (features.protobuf_1_4_3 or {}); + }; + protobuf_1_4_3_features = f: updateFeatures f (rec { + protobuf_1_4_3.bytes = + (f.protobuf_1_4_3.bytes or false) || + (f.protobuf_1_4_3.with-bytes or false) || + (protobuf_1_4_3.with-bytes or false); + protobuf_1_4_3.default = (f.protobuf_1_4_3.default or true); + }) []; + quick_error_0_2_2 = { features?(quick_error_0_2_2_features {}) }: quick_error_0_2_2_ {}; + quick_error_0_2_2_features = f: updateFeatures f (rec { + quick_error_0_2_2.default = (f.quick_error_0_2_2.default or true); + }) []; quote_0_3_15 = { features?(quote_0_3_15_features {}) }: quote_0_3_15_ {}; quote_0_3_15_features = f: updateFeatures f (rec { quote_0_3_15.default = (f.quote_0_3_15.default or true); @@ -1588,6 +1683,34 @@ rec { (f.serde_json_1_0_9.preserve_order or false) || (serde_json_1_0_9.preserve_order or false); }) [ dtoa_0_4_2_features itoa_0_3_4_features num_traits_0_1_41_features serde_1_0_27_features ]; + spin_0_4_6 = { features?(spin_0_4_6_features {}) }: spin_0_4_6_ { + features = mkFeatures (features.spin_0_4_6 or {}); + }; + spin_0_4_6_features = f: updateFeatures f (rec { + spin_0_4_6.asm = + (f.spin_0_4_6.asm or false) || + (f.spin_0_4_6.unstable or false) || + (spin_0_4_6.unstable or false); + spin_0_4_6.const_fn = + (f.spin_0_4_6.const_fn or false) || + (f.spin_0_4_6.once or false) || + (spin_0_4_6.once or false) || + (f.spin_0_4_6.unstable or false) || + (spin_0_4_6.unstable or false); + spin_0_4_6.core_intrinsics = + (f.spin_0_4_6.core_intrinsics or false) || + (f.spin_0_4_6.unstable or false) || + (spin_0_4_6.unstable or false); + spin_0_4_6.default = (f.spin_0_4_6.default or true); + spin_0_4_6.once = + (f.spin_0_4_6.once or false) || + (f.spin_0_4_6.unstable or false) || + (spin_0_4_6.unstable or false); + spin_0_4_6.unstable = + (f.spin_0_4_6.unstable or false) || + (f.spin_0_4_6.default or false) || + (spin_0_4_6.default or false); + }) []; syn_0_11_11 = { features?(syn_0_11_11_features {}) }: syn_0_11_11_ { dependencies = mapFeatures features ([ ] ++ (if features.syn_0_11_11.quote or false then [ quote_0_3_15 ] else []) diff --git a/ofborg/Cargo.lock b/ofborg/Cargo.lock index e766847..092422c 100644 --- a/ofborg/Cargo.lock +++ b/ofborg/Cargo.lock @@ -166,6 +166,11 @@ dependencies = [ "backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "foreign-types" version = "0.3.2" @@ -385,6 +390,7 @@ dependencies = [ "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "md5 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -425,6 +431,29 @@ name = "pkg-config" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "prometheus" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "protobuf" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "quick-error" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "quote" version = "0.3.15" @@ -552,6 +581,11 @@ dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "spin" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "syn" version = "0.11.11" @@ -765,6 +799,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" @@ -796,6 +831,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum openssl-sys 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "14ba54ac7d5a4eabd1d5f2c1fdeb7e7c14debfa669d94b983d01b465e767ba9e" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" +"checksum prometheus 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "71a963c5a59b4459a8133e60f8170df6fd29b67c0e6de5d45521d3056465bbfc" +"checksum protobuf 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bec26e67194b7d991908145fdf21b7cae8b08423d96dcb9e860cd31f854b9506" +"checksum quick-error 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ac990ab4e038dd8481a5e3fd00641067fcfc674ad663f3222752ed5284e05d4" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "512870020642bb8c221bf68baa1b2573da814f6ccfe5c9699b1c303047abe9b1" "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" @@ -812,6 +850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0" "checksum serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5" "checksum serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c9db7266c7d63a4c4b7fe8719656ccdd51acf1bed6124b174f933b009fb10bcb" +"checksum spin 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7e4deb3c2455c73779e6d3eebceae9599fc70957e54c69fe88f93aa48e62f432" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" diff --git a/ofborg/Cargo.toml b/ofborg/Cargo.toml index 5e4aade..2966039 100644 --- a/ofborg/Cargo.toml +++ b/ofborg/Cargo.toml @@ -23,6 +23,7 @@ hubcaps = { git = "https://github.com/grahamc/hubcaps.git" } hyper = "0.10.*" hyper-native-tls = "0.2.4" lru-cache = "0.1.1" +prometheus = "0.3.11" #[patch.crates-io]